home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / file / magic
Encoding:
M3U playlist  |  2009-06-05  |  523.0 KB  |  15,016 lines

  1. # Magic data for file(1) command.
  2. # Format is described in magic(5).
  3. # Don't edit this file, edit /etc/magic or send your suggested inclusions to
  4. # this file as a wishlist bug against file (using the reportbug utility).
  5.  
  6.  
  7. #------------------------------------------------------------------------------
  8. # Localstuff:  file(1) magic for locally observed files
  9. #
  10. # $File: Localstuff,v 1.4 2003/03/23 04:17:27 christos Exp $
  11. # Add any locally observed files here.  Remember:
  12. # text if readable, executable if runnable binary, data if unreadable.
  13. #------------------------------------------------------------------------------
  14. # acorn:  file(1) magic for files found on Acorn systems
  15. #
  16.  
  17. # RISC OS Chunk File Format
  18. # From RISC OS Programmer's Reference Manual, Appendix D
  19. # We guess the file type from the type of the first chunk.
  20. 0    lelong        0xc3cbc6c5    RISC OS Chunk data
  21. >12    string        OBJ_        \b, AOF object
  22. >12    string        LIB_        \b, ALF library
  23.  
  24. # RISC OS AIF, contains "SWI OS_Exit" at offset 16.
  25. 16    lelong        0xef000011    RISC OS AIF executable
  26.  
  27. # RISC OS Draw files
  28. # From RISC OS Programmer's Reference Manual, Appendix E
  29. 0    string         Draw        RISC OS Draw file data
  30.  
  31. # RISC OS new format font files
  32. # From RISC OS Programmer's Reference Manual, Appendix E
  33. 0    string        FONT\0        RISC OS outline font data,
  34. >5    byte        x        version %d
  35. 0    string        FONT\1        RISC OS 1bpp font data,
  36. >5    byte        x        version %d
  37. 0    string        FONT\4        RISC OS 4bpp font data
  38. >5    byte        x        version %d
  39.  
  40. # RISC OS Music files
  41. # From RISC OS Programmer's Reference Manual, Appendix E
  42. 0    string        Maestro\r    RISC OS music file
  43. >8    byte        x        version %d
  44.  
  45. >8    byte        x        type %d
  46.  
  47. # Digital Symphony data files
  48. # From: Bernard Jungen (bern8817@euphonynet.be)
  49. 0        string    \x02\x01\x13\x13\x13\x01\x0d\x10    Digital Symphony sound sample (RISC OS),
  50. >8        byte    x    version %d,
  51. >9        pstring    x    named "%s",
  52. >(9.b+19)    byte    =0    8-bit logarithmic
  53. >(9.b+19)    byte    =1    LZW-compressed linear
  54. >(9.b+19)    byte    =2    8-bit linear signed
  55. >(9.b+19)    byte    =3    16-bit linear signed
  56. >(9.b+19)    byte    =4    SigmaDelta-compressed linear
  57. >(9.b+19)    byte    =5    SigmaDelta-compressed logarithmic
  58. >(9.b+19)    byte    >5    unknown format
  59.  
  60. 0    string    \x02\x01\x13\x13\x14\x12\x01\x0b    Digital Symphony song (RISC OS),
  61. >8    byte    x    version %d,
  62. >9    byte    =1    1 voice,
  63. >9    byte    !1    %d voices,
  64. >10    leshort    =1    1 track,
  65. >10    leshort    !1    %d tracks,
  66. >12    leshort    =1    1 pattern
  67. >12    leshort    !1    %d patterns
  68.  
  69. 0    string    \x02\x01\x13\x13\x10\x14\x12\x0e
  70. >9    byte    =0    Digital Symphony sequence (RISC OS),
  71. >>8    byte    x    version %d,
  72. >>10    byte    =1    1 line,
  73. >>10    byte    !1    %d lines,
  74. >>11    leshort    =1    1 position
  75. >>11    leshort    !1    %d positions
  76. >9    byte    =1    Digital Symphony pattern data (RISC OS),
  77. >>8    byte    x    version %d,
  78. >>10    leshort    =1    1 pattern
  79. >>10    leshort    !1    %d patterns
  80.  
  81. #------------------------------------------------------------------------------
  82. # adi: file(1) magic for ADi's objects
  83. # From Gregory McGarry <g.mcgarry@ieee.org>
  84. #
  85. 0    leshort        0x521c        COFF DSP21k
  86. >18    lelong        &02        executable,
  87. >18    lelong        ^02
  88. >>18    lelong        &01        static object,
  89. >>18    lelong        ^01        relocatable object,
  90. >18    lelong        &010        stripped
  91. >18    lelong        ^010        not stripped
  92.  
  93. #------------------------------------------------------------------------------
  94. # adventure: file(1) magic for Adventure game files
  95. #
  96. # from Allen Garvin <earendil@faeryland.tamu-commerce.edu>
  97. # Edited by Dave Chapeskie <dchapes@ddm.on.ca> Jun 28, 1998
  98. # Edited by Chris Chittleborough <cchittleborough@yahoo.com.au>, March 2002
  99. #
  100. # ALAN
  101. # I assume there are other, lower versions, but these are the only ones I
  102. # saw in the archive.
  103. 0    beshort    0x0206    ALAN game data
  104. >2    byte    <10    version 2.6%d
  105.  
  106.  
  107. # Infocom (see z-machine)
  108. #------------------------------------------------------------------------------
  109. # Z-machine:  file(1) magic for Z-machine binaries.
  110. #
  111. # This will match ${TEX_BASE}/texmf/omega/ocp/char2uni/inbig5.ocp which
  112. # appears to be a version-0 Z-machine binary.
  113. #
  114. # The (false match) message is to correct that behavior.  Perhaps it is
  115. # not needed.
  116. #
  117. 16    belong&0xfe00f0f0    0x3030    Infocom game data
  118. >0    ubyte            0    (false match)
  119. >0    ubyte            >0    (Z-machine %d,
  120. >>2    ubeshort        x    Release %d /
  121. >>18    string            >\0    Serial %.6s)
  122.  
  123. #------------------------------------------------------------------------------
  124. # Glulx:  file(1) magic for Glulx binaries.
  125. #
  126. # I haven't checked for false matches yet.
  127. #
  128. 0    string            Glul    Glulx game data
  129. >4    beshort            x    (Version %d
  130. >>6    byte            x    \b.%d
  131. >>8    byte            x    \b.%d)
  132. >36    string            Info    Compiled by Inform
  133.  
  134.  
  135.  
  136. # For Quetzal and blorb magic see iff
  137.  
  138.  
  139. # TADS (Text Adventure Development System)
  140. #  All files are machine-independent (games compile to byte-code) and are tagged
  141. #  with a version string of the form "V2.<digit>.<digit>\0" (but TADS 3 is
  142. #  on the way).
  143. #  Game files start with "TADS2 bin\n\r\032\0" then the compiler version.
  144. 0    string    TADS2\ bin    TADS
  145. >9    belong  !0x0A0D1A00    game data, CORRUPTED
  146. >9    belong     0x0A0D1A00
  147. >>13    string    >\0        %s game data
  148. #  Resource files start with "TADS2 rsc\n\r\032\0" then the compiler version.
  149. 0    string    TADS2\ rsc    TADS
  150. >9    belong  !0x0A0D1A00    resource data, CORRUPTED
  151. >9    belong     0x0A0D1A00
  152. >>13    string    >\0        %s resource data
  153. #  Some saved game files start with "TADS2 save/g\n\r\032\0", a little-endian
  154. #  2-byte length N, the N-char name of the game file *without* a NUL (darn!),
  155. # "TADS2 save\n\r\032\0" and the interpreter version. 
  156. 0    string    TADS2\ save/g    TADS
  157. >12    belong    !0x0A0D1A00    saved game data, CORRUPTED
  158. >12    belong     0x0A0D1A00
  159. >>(16.s+32) string >\0        %s saved game data
  160. #  Other saved game files start with "TADS2 save\n\r\032\0" and the interpreter
  161. #  version.
  162. 0    string    TADS2\ save    TADS
  163. >10    belong    !0x0A0D1A00    saved game data, CORRUPTED
  164. >10    belong     0x0A0D1A00
  165. >>14    string    >\0        %s saved game data
  166.  
  167. # Danny Milosavljevic <danny.milo@gmx.net>
  168. # this are adrift (adventure game standard) game files, extension .taf
  169. # depending on version magic continues with 0x93453E6139FA (V 4.0)
  170. # 0x9445376139FA (V 3.90)
  171. # 0x9445366139FA (V 3.80)
  172. # this is from source (http://www.adrift.org.uk/) and I have some taf
  173. # files, and checked them.
  174. #0    belong    0x3C423FC9
  175. #>4    belong    0x6A87C2CF    Adrift game file
  176. #!:mime    application/x-adrift
  177. #------------------------------------------------------------------------------
  178. # allegro:  file(1) magic for Allegro datafiles
  179. # Toby Deshane <hac@shoelace.digivill.net>
  180. #
  181. 0 belong 0x736C6821   Allegro datafile (packed)
  182. 0 belong 0x736C682E   Allegro datafile (not packed/autodetect)
  183. 0 belong 0x736C682B   Allegro datafile (appended exe data)
  184.  
  185. #------------------------------------------------------------------------------
  186. # alliant:  file(1) magic for Alliant FX series a.out files
  187. #
  188. # If the FX series is the one that had a processor with a 68K-derived
  189. # instruction set, the "short" should probably become "beshort" and the
  190. # "long" should probably become "belong".
  191. # If it's the i860-based one, they should probably become either the
  192. # big-endian or little-endian versions, depending on the mode they ran
  193. # the 860 in....
  194. #
  195. 0    short        0420        0420 Alliant virtual executable
  196. >2    short        &0x0020        common library
  197. >16    long        >0        not stripped
  198. 0    short        0421        0421 Alliant compact executable
  199. >2    short        &0x0020        common library
  200. >16    long        >0        not stripped
  201. #------------------------------------------------------------------------------
  202. # alpha architecture description
  203. #
  204.  
  205. 0    leshort        0603        COFF format alpha
  206. >22    leshort&030000    !020000        executable
  207. >24    leshort        0410        pure
  208. >24    leshort        0413        paged
  209. >22    leshort&020000    !0        dynamically linked
  210. >16    lelong        !0        not stripped
  211. >16    lelong        0        stripped
  212. >22    leshort&030000    020000        shared library
  213. >24    leshort        0407        object
  214. >27    byte        x        - version %d
  215. >26    byte        x        .%d
  216. >28    byte        x        -%d
  217.  
  218. # Basic recognition of Digital UNIX core dumps - Mike Bremford <mike@opac.bl.uk>
  219. #
  220. # The actual magic number is just "Core", followed by a 2-byte version
  221. # number; however, treating any file that begins with "Core" as a Digital
  222. # UNIX core dump file may produce too many false hits, so we include one
  223. # byte of the version number as well; DU 5.0 appears only to be up to
  224. # version 2.
  225. #
  226. 0    string        Core\001    Alpha COFF format core dump (Digital UNIX)
  227. >24    string        >\0        \b, from '%s'
  228. 0    string        Core\002    Alpha COFF format core dump (Digital UNIX)
  229. >24    string        >\0        \b, from '%s'
  230.  
  231. #------------------------------------------------------------------------------
  232. # amanda:  file(1) magic for amanda file format
  233. #
  234. 0    string    AMANDA:\         AMANDA 
  235. >8    string    TAPESTART\ DATE        tape header file,
  236. >>23    string    X
  237. >>>25    string    >\             Unused %s
  238. >>23    string    >\             DATE %s
  239. >8    string    FILE\             dump file,
  240. >>13    string    >\             DATE %s
  241. #------------------------------------------------------------------------------
  242. # amigaos:  file(1) magic for AmigaOS binary formats:
  243.  
  244. #
  245. # From ignatios@cs.uni-bonn.de (Ignatios Souvatzis)
  246. #
  247. 0    belong        0x000003fa    AmigaOS shared library
  248. 0    belong        0x000003f3    AmigaOS loadseg()ble executable/binary
  249. 0    belong        0x000003e7    AmigaOS object/library data
  250. #
  251. 0    beshort        0xe310        Amiga Workbench
  252. >2    beshort        1        
  253. >>48    byte        1        disk icon
  254. >>48    byte        2        drawer icon
  255. >>48    byte        3        tool icon
  256. >>48    byte        4        project icon
  257. >>48    byte        5        garbage icon
  258. >>48    byte        6        device icon
  259. >>48    byte        7        kickstart icon
  260. >>48    byte        8        workbench application icon
  261. >2    beshort        >1        icon, vers. %d
  262. #
  263. # various sound formats from the Amiga
  264. # G=F6tz Waschk <waschk@informatik.uni-rostock.de>
  265. #
  266. 0    string        FC14        Future Composer 1.4 Module sound file
  267. 0    string        SMOD        Future Composer 1.3 Module sound file
  268. 0    string        AON4artofnoise    Art Of Noise Module sound file
  269. 1    string        MUGICIAN/SOFTEYES Mugician Module sound file
  270. 58    string        SIDMON\ II\ -\ THE    Sidmon 2.0 Module sound file
  271. 0    string        Synth4.0    Synthesis Module sound file
  272. 0    string        ARP.        The Holy Noise Module sound file
  273. 0    string        BeEp\0        JamCracker Module sound file
  274. 0    string        COSO\0        Hippel-COSO Module sound file
  275. # Too simple (short, pure ASCII, deep), MPi
  276. #26    string        V.3        Brian Postma's Soundmon Module sound file v3
  277. #26    string        BPSM        Brian Postma's Soundmon Module sound file v3
  278. #26    string        V.2        Brian Postma's Soundmon Module sound file v2
  279.  
  280. # The following are from: "Stefan A. Haubenthal" <polluks@web.de>
  281. 0    beshort        0x0f00        AmigaOS bitmap font
  282. 0    beshort        0x0f03        AmigaOS outline font
  283. 0    belong        0x80001001    AmigaOS outline tag
  284. 0    string        ##\ version    catalog translation
  285. 0    string        EMOD\0        Amiga E module
  286. 8    string        ECXM\0        ECX module
  287. 0    string/c    @database    AmigaGuide file
  288.  
  289. # Amiga disk types
  290. 0    string        RDSK        Rigid Disk Block
  291. >160    string        x        on %.24s
  292. 0    string        DOS\0        Amiga DOS disk
  293. 0    string        DOS\1        Amiga FFS disk
  294. 0    string        DOS\2        Amiga Inter DOS disk
  295. 0    string        DOS\3        Amiga Inter FFS disk
  296. 0    string        DOS\4        Amiga Fastdir DOS disk
  297. 0    string        DOS\5        Amiga Fastdir FFS disk
  298. 0    string        KICK        Kickstart disk
  299.  
  300. # From: Alex Beregszaszi <alex@fsn.hu>
  301. 0    string        LZX        LZX compressed archive (Amiga)
  302.  
  303.  
  304. #------------------------------------------------------------------------------
  305. # animation:  file(1) magic for animation/movie formats
  306. #
  307. # animation formats
  308. # MPEG, FLI, DL originally from vax@ccwf.cc.utexas.edu (VaX#n8)
  309. # FLC, SGI, Apple originally from Daniel Quinlan (quinlan@yggdrasil.com)
  310.  
  311. # SGI and Apple formats
  312. 0    string        MOVI        Silicon Graphics movie file
  313. !:mime    video/x-sgi-movie
  314. 4       string          moov            Apple QuickTime
  315. !:mime    video/quicktime
  316. >12     string          mvhd            \b movie (fast start)
  317. >12     string          mdra            \b URL
  318. >12     string          cmov            \b movie (fast start, compressed header)
  319. >12     string          rmra            \b multiple URLs
  320. 4       string          mdat            Apple QuickTime movie (unoptimized)
  321. !:mime    video/quicktime
  322. #4       string          wide            Apple QuickTime movie (unoptimized)
  323. #!:mime    video/quicktime
  324. #4       string          skip            Apple QuickTime movie (modified)
  325. #!:mime    video/quicktime
  326. #4       string          free            Apple QuickTime movie (modified)
  327. #!:mime    video/quicktime
  328. 4       string          idsc            Apple QuickTime image (fast start)
  329. !:mime    image/x-quicktime
  330. #4       string          idat            Apple QuickTime image (unoptimized)
  331. #!:mime    image/x-quicktime
  332. 4       string          pckg            Apple QuickTime compressed archive
  333. !:mime    application/x-quicktime-player
  334. 4    string/B    jP        JPEG 2000 image
  335. !:mime    image/jp2
  336. 4    string        ftyp        ISO Media
  337. >8    string        isom        \b, MPEG v4 system, version 1
  338. !:mime    video/mp4
  339. >8    string        iso2        \b, MPEG v4 system, part 12 revision
  340. >8    string        mp41        \b, MPEG v4 system, version 1
  341. !:mime    video/mp4
  342. >8    string        mp42        \b, MPEG v4 system, version 2
  343. !:mime    video/mp4
  344. >8    string        mp7t        \b, MPEG v4 system, MPEG v7 XML
  345. >8    string        mp7b        \b, MPEG v4 system, MPEG v7 binary XML
  346. >8    string/B    jp2        \b, JPEG 2000
  347. !:mime    image/jp2
  348. >8    string        3gp        \b, MPEG v4 system, 3GPP
  349. !:mime    video/3gpp
  350. >>11    byte        4        \b v4 (H.263/AMR GSM 6.10)
  351. >>11    byte        5        \b v5 (H.263/AMR GSM 6.10)
  352. >>11    byte        6        \b v6 (ITU H.264/AMR GSM 6.10)
  353. >8    string        mmp4        \b, MPEG v4 system, 3GPP Mobile
  354. !:mime    video/mp4
  355. >8    string        avc1        \b, MPEG v4 system, 3GPP JVT AVC
  356. !:mime    video/3gpp
  357. >8    string/B    M4A        \b, MPEG v4 system, iTunes AAC-LC
  358. !:mime    audio/mp4
  359. >8    string/B    M4V        \b, MPEG v4 system, iTunes AVC-LC
  360. !:mime    video/mp4
  361. >8    string/B    M4P        \b, MPEG v4 system, iTunes AES encrypted
  362. >8    string/B    M4B        \b, MPEG v4 system, iTunes bookmarked
  363. >8    string/B    qt        \b, Apple QuickTime movie
  364. !:mime    video/quicktime
  365.  
  366. # MPEG sequences
  367. # Scans for all common MPEG header start codes
  368. 0     belong            0x00000001     
  369. >4     byte&0x1F        0x07       JVT NAL sequence, H.264 video
  370. >>5      byte               66             \b, baseline
  371. >>5      byte               77             \b, main
  372. >>5      byte               88             \b, extended
  373. >>7      byte               x              \b @ L %u
  374. 0        belong&0xFFFFFF00  0x00000100     
  375. >3       byte               0xBA           MPEG sequence
  376. >>4      byte               &0x40          \b, v2, program multiplex
  377. >>4      byte               ^0x40          \b, v1, system multiplex
  378. >3       byte               0xBB           MPEG sequence, v1/2, multiplex (missing pack header)
  379. >3       byte&0x1F          0x07           MPEG sequence, H.264 video
  380. >>4      byte               66             \b, baseline
  381. >>4      byte               77             \b, main
  382. >>4      byte               88             \b, extended
  383. >>6      byte               x              \b @ L %u
  384. >3       byte               0xB0           MPEG sequence, v4
  385. >>5      belong             0x000001B5
  386. >>>9     byte               &0x80
  387. >>>>10   byte&0xF0          16             \b, video
  388. >>>>10   byte&0xF0          32             \b, still texture
  389. >>>>10   byte&0xF0          48             \b, mesh
  390. >>>>10   byte&0xF0          64             \b, face
  391. >>>9     byte&0xF8          8              \b, video
  392. >>>9     byte&0xF8          16             \b, still texture
  393. >>>9     byte&0xF8          24             \b, mesh
  394. >>>9     byte&0xF8          32             \b, face
  395. >>4      byte               1              \b, simple @ L1
  396. >>4      byte               2              \b, simple @ L2
  397. >>4      byte               3              \b, simple @ L3
  398. >>4      byte               4              \b, simple @ L0
  399. >>4      byte               17             \b, simple scalable @ L1
  400. >>4      byte               18             \b, simple scalable @ L2
  401. >>4      byte               33             \b, core @ L1
  402. >>4      byte               34             \b, core @ L2
  403. >>4      byte               50             \b, main @ L2
  404. >>4      byte               51             \b, main @ L3
  405. >>4      byte               53             \b, main @ L4
  406. >>4      byte               66             \b, n-bit @ L2
  407. >>4      byte               81             \b, scalable texture @ L1
  408. >>4      byte               97             \b, simple face animation @ L1
  409. >>4      byte               98             \b, simple face animation @ L2
  410. >>4      byte               99             \b, simple face basic animation @ L1
  411. >>4      byte               100            \b, simple face basic animation @ L2
  412. >>4      byte               113            \b, basic animation text @ L1
  413. >>4      byte               114            \b, basic animation text @ L2
  414. >>4      byte               129            \b, hybrid @ L1
  415. >>4      byte               130            \b, hybrid @ L2
  416. >>4      byte               145            \b, advanced RT simple @ L!
  417. >>4      byte               146            \b, advanced RT simple @ L2
  418. >>4      byte               147            \b, advanced RT simple @ L3
  419. >>4      byte               148            \b, advanced RT simple @ L4
  420. >>4      byte               161            \b, core scalable @ L1
  421. >>4      byte               162            \b, core scalable @ L2
  422. >>4      byte               163            \b, core scalable @ L3
  423. >>4      byte               177            \b, advanced coding efficiency @ L1
  424. >>4      byte               178            \b, advanced coding efficiency @ L2
  425. >>4      byte               179            \b, advanced coding efficiency @ L3
  426. >>4      byte               180            \b, advanced coding efficiency @ L4
  427. >>4      byte               193            \b, advanced core @ L1
  428. >>4      byte               194            \b, advanced core @ L2
  429. >>4      byte               209            \b, advanced scalable texture @ L1
  430. >>4      byte               210            \b, advanced scalable texture @ L2
  431. >>4      byte               211            \b, advanced scalable texture @ L3
  432. >>4      byte               225            \b, simple studio @ L1
  433. >>4      byte               226            \b, simple studio @ L2
  434. >>4      byte               227            \b, simple studio @ L3
  435. >>4      byte               228            \b, simple studio @ L4
  436. >>4      byte               229            \b, core studio @ L1
  437. >>4      byte               230            \b, core studio @ L2
  438. >>4      byte               231            \b, core studio @ L3
  439. >>4      byte               232            \b, core studio @ L4
  440. >>4      byte               240            \b, advanced simple @ L0
  441. >>4      byte               241            \b, advanced simple @ L1
  442. >>4      byte               242            \b, advanced simple @ L2
  443. >>4      byte               243            \b, advanced simple @ L3
  444. >>4      byte               244            \b, advanced simple @ L4
  445. >>4      byte               245            \b, advanced simple @ L5
  446. >>4      byte               247            \b, advanced simple @ L3b
  447. >>4      byte               248            \b, FGS @ L0
  448. >>4      byte               249            \b, FGS @ L1
  449. >>4      byte               250            \b, FGS @ L2
  450. >>4      byte               251            \b, FGS @ L3
  451. >>4      byte               252            \b, FGS @ L4
  452. >>4      byte               253            \b, FGS @ L5
  453. >3       byte               0xB5           MPEG sequence, v4
  454. >>4      byte               &0x80
  455. >>>5     byte&0xF0          16             \b, video (missing profile header)
  456. >>>5     byte&0xF0          32             \b, still texture (missing profile header)
  457. >>>5     byte&0xF0          48             \b, mesh (missing profile header)
  458. >>>5     byte&0xF0          64             \b, face (missing profile header)
  459. >>4      byte&0xF8          8              \b, video (missing profile header)
  460. >>4      byte&0xF8          16             \b, still texture (missing profile header)
  461. >>4      byte&0xF8          24             \b, mesh (missing profile header)
  462. >>4      byte&0xF8          32             \b, face (missing profile header)
  463. >3       byte               0xB3           MPEG sequence
  464. >>12     belong             0x000001B8     \b, v1, progressive Y'CbCr 4:2:0 video
  465. >>12     belong             0x000001B2     \b, v1, progressive Y'CbCr 4:2:0 video
  466. >>12     belong             0x000001B5     \b, v2,
  467. >>>16    byte&0x0F          1              \b HP
  468. >>>16    byte&0x0F          2              \b Spt
  469. >>>16    byte&0x0F          3              \b SNR
  470. >>>16    byte&0x0F          4              \b MP
  471. >>>16    byte&0x0F          5              \b SP
  472. >>>17    byte&0xF0          64             \b@HL
  473. >>>17    byte&0xF0          96             \b@H-14
  474. >>>17    byte&0xF0          128            \b@ML
  475. >>>17    byte&0xF0          160            \b@LL
  476. >>>17    byte               &0x08          \b progressive
  477. >>>17    byte               ^0x08          \b interlaced
  478. >>>17    byte&0x06          2              \b Y'CbCr 4:2:0 video
  479. >>>17    byte&0x06          4              \b Y'CbCr 4:2:2 video
  480. >>>17    byte&0x06          6              \b Y'CbCr 4:4:4 video
  481. >>11     byte               &0x02
  482. >>>75    byte               &0x01
  483. >>>>140  belong             0x000001B8     \b, v1, progressive Y'CbCr 4:2:0 video
  484. >>>>140  belong             0x000001B2     \b, v1, progressive Y'CbCr 4:2:0 video
  485. >>>>140  belong             0x000001B5     \b, v2,
  486. >>>>>144 byte&0x0F          1              \b HP
  487. >>>>>144 byte&0x0F          2              \b Spt
  488. >>>>>144 byte&0x0F          3              \b SNR
  489. >>>>>144 byte&0x0F          4              \b MP
  490. >>>>>144 byte&0x0F          5              \b SP
  491. >>>>>145 byte&0xF0          64             \b@HL
  492. >>>>>145 byte&0xF0          96             \b@H-14
  493. >>>>>145 byte&0xF0          128            \b@ML
  494. >>>>>145 byte&0xF0          160            \b@LL
  495. >>>>>145 byte               &0x08          \b progressive
  496. >>>>>145 byte               ^0x08          \b interlaced
  497. >>>>>145 byte&0x06          2              \b Y'CbCr 4:2:0 video
  498. >>>>>145 byte&0x06          4              \b Y'CbCr 4:2:2 video
  499. >>>>>145 byte&0x06          6              \b Y'CbCr 4:4:4 video
  500. >>76    belong             0x000001B8     \b, v1, progressive Y'CbCr 4:2:0 video
  501. >>76    belong             0x000001B2     \b, v1, progressive Y'CbCr 4:2:0 video
  502. >>76    belong             0x000001B5     \b, v2,
  503. >>>80   byte&0x0F          1              \b HP
  504. >>>80   byte&0x0F          2              \b Spt
  505. >>>80   byte&0x0F          3              \b SNR
  506. >>>80   byte&0x0F          4              \b MP
  507. >>>80   byte&0x0F          5              \b SP
  508. >>>81   byte&0xF0          64             \b@HL
  509. >>>81   byte&0xF0          96             \b@H-14
  510. >>>81   byte&0xF0          128            \b@ML
  511. >>>81   byte&0xF0          160            \b@LL
  512. >>>81   byte               &0x08          \b progressive
  513. >>>81   byte               ^0x08          \b interlaced
  514. >>>81   byte&0x06          2              \b Y'CbCr 4:2:0 video
  515. >>>81   byte&0x06          4              \b Y'CbCr 4:2:2 video
  516. >>>81   byte&0x06          6              \b Y'CbCr 4:4:4 video
  517. >>4      belong&0xFFFFFF00  0x78043800     \b, HD-TV 1920P
  518. >>>7     byte&0xF0          0x10           \b, 16:9
  519. >>4      belong&0xFFFFFF00  0x50002D00     \b, SD-TV 1280I
  520. >>>7     byte&0xF0          0x10           \b, 16:9
  521. >>4      belong&0xFFFFFF00  0x30024000     \b, PAL Capture
  522. >>>7     byte&0xF0          0x10           \b, 4:3
  523. >>4      beshort&0xFFF0     0x2C00         \b, 4CIF
  524. >>>5     beshort&0x0FFF     0x01E0         \b NTSC
  525. >>>5     beshort&0x0FFF     0x0240         \b PAL
  526. >>>7     byte&0xF0          0x20           \b, 4:3
  527. >>>7     byte&0xF0          0x30           \b, 16:9
  528. >>>7     byte&0xF0          0x40           \b, 11:5
  529. >>>7     byte&0xF0          0x80           \b, PAL 4:3
  530. >>>7     byte&0xF0          0xC0           \b, NTSC 4:3
  531. >>4      belong&0xFFFFFF00  0x2801E000     \b, LD-TV 640P
  532. >>>7     byte&0xF0          0x10           \b, 4:3
  533. >>4      belong&0xFFFFFF00  0x1400F000     \b, 320x240
  534. >>>7     byte&0xF0          0x10           \b, 4:3
  535. >>4      belong&0xFFFFFF00  0x0F00A000     \b, 240x160
  536. >>>7     byte&0xF0          0x10           \b, 4:3
  537. >>4      belong&0xFFFFFF00  0x0A007800     \b, 160x120
  538. >>>7     byte&0xF0          0x10           \b, 4:3
  539. >>4      beshort&0xFFF0     0x1600         \b, CIF
  540. >>>5     beshort&0x0FFF     0x00F0         \b NTSC
  541. >>>5     beshort&0x0FFF     0x0120         \b PAL
  542. >>>7     byte&0xF0          0x20           \b, 4:3
  543. >>>7     byte&0xF0          0x30           \b, 16:9
  544. >>>7     byte&0xF0          0x40           \b, 11:5
  545. >>>7     byte&0xF0          0x80           \b, PAL 4:3
  546. >>>7     byte&0xF0          0xC0           \b, NTSC 4:3
  547. >>>5     beshort&0x0FFF     0x0240         \b PAL 625
  548. >>>>7    byte&0xF0          0x20           \b, 4:3
  549. >>>>7    byte&0xF0          0x30           \b, 16:9
  550. >>>>7    byte&0xF0          0x40           \b, 11:5
  551. >>4      beshort&0xFFF0     0x2D00         \b, CCIR/ITU
  552. >>>5     beshort&0x0FFF     0x01E0         \b NTSC 525
  553. >>>5     beshort&0x0FFF     0x0240         \b PAL 625
  554. >>>7     byte&0xF0          0x20           \b, 4:3
  555. >>>7     byte&0xF0          0x30           \b, 16:9
  556. >>>7     byte&0xF0          0x40           \b, 11:5
  557. >>4      beshort&0xFFF0     0x1E00         \b, SVCD
  558. >>>5     beshort&0x0FFF     0x01E0         \b NTSC 525
  559. >>>5     beshort&0x0FFF     0x0240         \b PAL 625
  560. >>>7     byte&0xF0          0x20           \b, 4:3
  561. >>>7     byte&0xF0          0x30           \b, 16:9
  562. >>>7     byte&0xF0          0x40           \b, 11:5
  563. >>7      byte&0x0F          1              \b, 23.976 fps
  564. >>7      byte&0x0F          2              \b, 24 fps
  565. >>7      byte&0x0F          3              \b, 25 fps
  566. >>7      byte&0x0F          4              \b, 29.97 fps
  567. >>7      byte&0x0F          5              \b, 30 fps
  568. >>7      byte&0x0F          6              \b, 50 fps
  569. >>7      byte&0x0F          7              \b, 59.94 fps
  570. >>7      byte&0x0F          8              \b, 60 fps
  571. >>11     byte               &0x04          \b, Constrained
  572.  
  573. # MPEG ADTS Audio (*.mpx/mxa/aac)
  574. # from dreesen@math.fu-berlin.de
  575. # modified to fully support MPEG ADTS
  576.  
  577. # MP3, M1A
  578. # modified by Joerg Jenderek
  579. # GRR the original test are too common for many DOS files
  580. # so don't accept as MP3 until we've tested the rate
  581. 0       beshort&0xFFFE  0xFFFA
  582. # rates
  583. >2      byte&0xF0       0x10           MPEG ADTS, layer III, v1,  32 kbps
  584. !:mime    audio/mpeg
  585. >2      byte&0xF0       0x20           MPEG ADTS, layer III, v1,  40 kbps
  586. !:mime    audio/mpeg
  587. >2      byte&0xF0       0x30           MPEG ADTS, layer III, v1,  48 kbps
  588. !:mime    audio/mpeg
  589. >2      byte&0xF0       0x40           MPEG ADTS, layer III, v1,  56 kbps
  590. !:mime    audio/mpeg
  591. >2      byte&0xF0       0x50           MPEG ADTS, layer III, v1,  64 kbps
  592. !:mime    audio/mpeg
  593. >2      byte&0xF0       0x60           MPEG ADTS, layer III, v1,  80 kbps
  594. !:mime    audio/mpeg
  595. >2      byte&0xF0       0x70           MPEG ADTS, layer III, v1,  96 kbps
  596. !:mime    audio/mpeg
  597. >2      byte&0xF0       0x80           MPEG ADTS, layer III, v1, 112 kbps
  598. !:mime    audio/mpeg
  599. >2      byte&0xF0       0x90           MPEG ADTS, layer III, v1, 128 kbps
  600. !:mime    audio/mpeg
  601. >2      byte&0xF0       0xA0           MPEG ADTS, layer III, v1, 160 kbps
  602. !:mime    audio/mpeg
  603. >2      byte&0xF0       0xB0           MPEG ADTS, layer III, v1, 192 kbps
  604. !:mime    audio/mpeg
  605. >2      byte&0xF0       0xC0           MPEG ADTS, layer III, v1, 224 kbps
  606. !:mime    audio/mpeg
  607. >2      byte&0xF0       0xD0           MPEG ADTS, layer III, v1, 256 kbps
  608. !:mime    audio/mpeg
  609. >2      byte&0xF0       0xE0           MPEG ADTS, layer III, v1, 320 kbps
  610. !:mime    audio/mpeg
  611. # timing
  612. >2      byte&0x0C       0x00           \b, 44.1 kHz
  613. >2      byte&0x0C       0x04           \b, 48 kHz
  614. >2      byte&0x0C       0x08           \b, 32 kHz
  615. # channels/options
  616. >3      byte&0xC0       0x00           \b, Stereo
  617. >3      byte&0xC0       0x40           \b, JntStereo
  618. >3      byte&0xC0       0x80           \b, 2x Monaural
  619. >3      byte&0xC0       0xC0           \b, Monaural
  620. #>1     byte            ^0x01          \b, Data Verify
  621. #>2     byte            &0x02          \b, Packet Pad
  622. #>2     byte            &0x01          \b, Custom Flag
  623. #>3     byte            &0x08          \b, Copyrighted
  624. #>3     byte            &0x04          \b, Original Source
  625. #>3     byte&0x03       1              \b, NR: 50/15 ms
  626. #>3     byte&0x03       3              \b, NR: CCIT J.17
  627.  
  628. # MP2, M1A
  629. 0       beshort&0xFFFE  0xFFFC         MPEG ADTS, layer II, v1
  630. # rates
  631. >2      byte&0xF0       0x10           \b,  32 kbps
  632. >2      byte&0xF0       0x20           \b,  48 kbps
  633. >2      byte&0xF0       0x30           \b,  56 kbps
  634. >2      byte&0xF0       0x40           \b,  64 kbps
  635. >2      byte&0xF0       0x50           \b,  80 kbps
  636. >2      byte&0xF0       0x60           \b,  96 kbps
  637. >2      byte&0xF0       0x70           \b, 112 kbps
  638. >2      byte&0xF0       0x80           \b, 128 kbps
  639. >2      byte&0xF0       0x90           \b, 160 kbps
  640. >2      byte&0xF0       0xA0           \b, 192 kbps
  641. >2      byte&0xF0       0xB0           \b, 224 kbps
  642. >2      byte&0xF0       0xC0           \b, 256 kbps
  643. >2      byte&0xF0       0xD0           \b, 320 kbps
  644. >2      byte&0xF0       0xE0           \b, 384 kbps
  645. # timing
  646. >2      byte&0x0C       0x00           \b, 44.1 kHz
  647. >2      byte&0x0C       0x04           \b, 48 kHz
  648. >2      byte&0x0C       0x08           \b, 32 kHz
  649. # channels/options
  650. >3      byte&0xC0       0x00           \b, Stereo
  651. >3      byte&0xC0       0x40           \b, JntStereo
  652. >3      byte&0xC0       0x80           \b, 2x Monaural
  653. >3      byte&0xC0       0xC0           \b, Monaural
  654. #>1     byte            ^0x01          \b, Data Verify
  655. #>2     byte            &0x02          \b, Packet Pad
  656. #>2     byte            &0x01          \b, Custom Flag
  657. #>3     byte            &0x08          \b, Copyrighted
  658. #>3     byte            &0x04          \b, Original Source
  659. #>3     byte&0x03       1              \b, NR: 50/15 ms
  660. #>3     byte&0x03       3              \b, NR: CCIT J.17
  661.  
  662. # MPA, M1A
  663. # updated by Joerg Jenderek
  664. # GRR the original test are too common for many DOS files, so test 32 <= kbits <= 448
  665. # GRR this test is still too general as it catches a BOM of UTF-16 files (0xFFFE)
  666. # FIXME: Almost all little endian UTF-16 text with BOM are clobbered by these entries
  667. #0    beshort&0xFFFE        0xFFFE    
  668. #>2    ubyte&0xF0    >0x0F        
  669. #>>2    ubyte&0xF0    <0xE1        MPEG ADTS, layer I, v1
  670. ## rate
  671. #>>>2      byte&0xF0       0x10           \b,  32 kbps
  672. #>>>2      byte&0xF0       0x20           \b,  64 kbps
  673. #>>>2      byte&0xF0       0x30           \b,  96 kbps
  674. #>>>2      byte&0xF0       0x40           \b, 128 kbps
  675. #>>>2      byte&0xF0       0x50           \b, 160 kbps
  676. #>>>2      byte&0xF0       0x60           \b, 192 kbps
  677. #>>>2      byte&0xF0       0x70           \b, 224 kbps
  678. #>>>2      byte&0xF0       0x80           \b, 256 kbps
  679. #>>>2      byte&0xF0       0x90           \b, 288 kbps
  680. #>>>2      byte&0xF0       0xA0           \b, 320 kbps
  681. #>>>2      byte&0xF0       0xB0           \b, 352 kbps
  682. #>>>2      byte&0xF0       0xC0           \b, 384 kbps
  683. #>>>2      byte&0xF0       0xD0           \b, 416 kbps
  684. #>>>2      byte&0xF0       0xE0           \b, 448 kbps
  685. ## timing
  686. #>>>2      byte&0x0C       0x00           \b, 44.1 kHz
  687. #>>>2      byte&0x0C       0x04           \b, 48 kHz
  688. #>>>2      byte&0x0C       0x08           \b, 32 kHz
  689. ## channels/options
  690. #>>>3      byte&0xC0       0x00           \b, Stereo
  691. #>>>3      byte&0xC0       0x40           \b, JntStereo
  692. #>>>3      byte&0xC0       0x80           \b, 2x Monaural
  693. #>>>3      byte&0xC0       0xC0           \b, Monaural
  694. ##>1     byte            ^0x01          \b, Data Verify
  695. ##>2     byte            &0x02          \b, Packet Pad
  696. ##>2     byte            &0x01          \b, Custom Flag
  697. ##>3     byte            &0x08          \b, Copyrighted
  698. ##>3     byte            &0x04          \b, Original Source
  699. ##>3     byte&0x03       1              \b, NR: 50/15 ms
  700. ##>3     byte&0x03       3              \b, NR: CCIT J.17
  701.  
  702. # MP3, M2A
  703. 0       beshort&0xFFFE  0xFFF2         MPEG ADTS, layer III, v2
  704. # rate
  705. >2      byte&0xF0       0x10           \b,   8 kbps
  706. >2      byte&0xF0       0x20           \b,  16 kbps
  707. >2      byte&0xF0       0x30           \b,  24 kbps
  708. >2      byte&0xF0       0x40           \b,  32 kbps
  709. >2      byte&0xF0       0x50           \b,  40 kbps
  710. >2      byte&0xF0       0x60           \b,  48 kbps
  711. >2      byte&0xF0       0x70           \b,  56 kbps
  712. >2      byte&0xF0       0x80           \b,  64 kbps
  713. >2      byte&0xF0       0x90           \b,  80 kbps
  714. >2      byte&0xF0       0xA0           \b,  96 kbps
  715. >2      byte&0xF0       0xB0           \b, 112 kbps
  716. >2      byte&0xF0       0xC0           \b, 128 kbps
  717. >2      byte&0xF0       0xD0           \b, 144 kbps
  718. >2      byte&0xF0       0xE0           \b, 160 kbps
  719. # timing
  720. >2      byte&0x0C       0x00           \b, 22.05 kHz
  721. >2      byte&0x0C       0x04           \b, 24 kHz
  722. >2      byte&0x0C       0x08           \b, 16 kHz
  723. # channels/options
  724. >3      byte&0xC0       0x00           \b, Stereo
  725. >3      byte&0xC0       0x40           \b, JntStereo
  726. >3      byte&0xC0       0x80           \b, 2x Monaural
  727. >3      byte&0xC0       0xC0           \b, Monaural
  728. #>1     byte            ^0x01          \b, Data Verify
  729. #>2     byte            &0x02          \b, Packet Pad
  730. #>2     byte            &0x01          \b, Custom Flag
  731. #>3     byte            &0x08          \b, Copyrighted
  732. #>3     byte            &0x04          \b, Original Source
  733. #>3     byte&0x03       1              \b, NR: 50/15 ms
  734. #>3     byte&0x03       3              \b, NR: CCIT J.17
  735.  
  736. # MP2, M2A
  737. 0       beshort&0xFFFE  0xFFF4         MPEG ADTS, layer II, v2
  738. # rate 
  739. >2      byte&0xF0       0x10           \b,   8 kbps
  740. >2      byte&0xF0       0x20           \b,  16 kbps 
  741. >2      byte&0xF0       0x30           \b,  24 kbps
  742. >2      byte&0xF0       0x40           \b,  32 kbps
  743. >2      byte&0xF0       0x50           \b,  40 kbps
  744. >2      byte&0xF0       0x60           \b,  48 kbps
  745. >2      byte&0xF0       0x70           \b,  56 kbps
  746. >2      byte&0xF0       0x80           \b,  64 kbps
  747. >2      byte&0xF0       0x90           \b,  80 kbps
  748. >2      byte&0xF0       0xA0           \b,  96 kbps
  749. >2      byte&0xF0       0xB0           \b, 112 kbps
  750. >2      byte&0xF0       0xC0           \b, 128 kbps
  751. >2      byte&0xF0       0xD0           \b, 144 kbps
  752. >2      byte&0xF0       0xE0           \b, 160 kbps
  753. # timing
  754. >2      byte&0x0C       0x00           \b, 22.05 kHz
  755. >2      byte&0x0C       0x04           \b, 24 kHz
  756. >2      byte&0x0C       0x08           \b, 16 kHz
  757. # channels/options
  758. >3      byte&0xC0       0x00           \b, Stereo
  759. >3      byte&0xC0       0x40           \b, JntStereo
  760. >3      byte&0xC0       0x80           \b, 2x Monaural
  761. >3      byte&0xC0       0xC0           \b, Monaural
  762. #>1     byte            ^0x01          \b, Data Verify
  763. #>2     byte            &0x02          \b, Packet Pad
  764. #>2     byte            &0x01          \b, Custom Flag
  765. #>3     byte            &0x08          \b, Copyrighted
  766. #>3     byte            &0x04          \b, Original Source
  767. #>3     byte&0x03       1              \b, NR: 50/15 ms
  768. #>3     byte&0x03       3              \b, NR: CCIT J.17
  769.  
  770. # MPA, M2A
  771. 0       beshort&0xFFFE  0xFFF6         MPEG ADTS, layer I, v2
  772. # rate
  773. >2      byte&0xF0       0x10           \b,  32 kbps
  774. >2      byte&0xF0       0x20           \b,  48 kbps
  775. >2      byte&0xF0       0x30           \b,  56 kbps
  776. >2      byte&0xF0       0x40           \b,  64 kbps
  777. >2      byte&0xF0       0x50           \b,  80 kbps
  778. >2      byte&0xF0       0x60           \b,  96 kbps
  779. >2      byte&0xF0       0x70           \b, 112 kbps
  780. >2      byte&0xF0       0x80           \b, 128 kbps
  781. >2      byte&0xF0       0x90           \b, 144 kbps
  782. >2      byte&0xF0       0xA0           \b, 160 kbps
  783. >2      byte&0xF0       0xB0           \b, 176 kbps
  784. >2      byte&0xF0       0xC0           \b, 192 kbps
  785. >2      byte&0xF0       0xD0           \b, 224 kbps
  786. >2      byte&0xF0       0xE0           \b, 256 kbps
  787. # timing
  788. >2      byte&0x0C       0x00           \b, 22.05 kHz
  789. >2      byte&0x0C       0x04           \b, 24 kHz
  790. >2      byte&0x0C       0x08           \b, 16 kHz
  791. # channels/options
  792. >3      byte&0xC0       0x00           \b, Stereo
  793. >3      byte&0xC0       0x40           \b, JntStereo
  794. >3      byte&0xC0       0x80           \b, 2x Monaural
  795. >3      byte&0xC0       0xC0           \b, Monaural
  796. #>1     byte            ^0x01          \b, Data Verify
  797. #>2     byte            &0x02          \b, Packet Pad
  798. #>2     byte            &0x01          \b, Custom Flag
  799. #>3     byte            &0x08          \b, Copyrighted
  800. #>3     byte            &0x04          \b, Original Source
  801. #>3     byte&0x03       1              \b, NR: 50/15 ms
  802. #>3     byte&0x03       3              \b, NR: CCIT J.17
  803.  
  804. # MP3, M25A
  805. 0       beshort&0xFFFE  0xFFE2         MPEG ADTS, layer III,  v2.5
  806. # rate  
  807. >2      byte&0xF0       0x10           \b,   8 kbps
  808. >2      byte&0xF0       0x20           \b,  16 kbps
  809. >2      byte&0xF0       0x30           \b,  24 kbps
  810. >2      byte&0xF0       0x40           \b,  32 kbps
  811. >2      byte&0xF0       0x50           \b,  40 kbps
  812. >2      byte&0xF0       0x60           \b,  48 kbps
  813. >2      byte&0xF0       0x70           \b,  56 kbps
  814. >2      byte&0xF0       0x80           \b,  64 kbps
  815. >2      byte&0xF0       0x90           \b,  80 kbps
  816. >2      byte&0xF0       0xA0           \b,  96 kbps
  817. >2      byte&0xF0       0xB0           \b, 112 kbps
  818. >2      byte&0xF0       0xC0           \b, 128 kbps
  819. >2      byte&0xF0       0xD0           \b, 144 kbps
  820. >2      byte&0xF0       0xE0           \b, 160 kbps
  821. # timing
  822. >2      byte&0x0C       0x00           \b, 11.025 kHz
  823. >2      byte&0x0C       0x04           \b, 12 kHz
  824. >2      byte&0x0C       0x08           \b, 8 kHz
  825. # channels/options
  826. >3      byte&0xC0       0x00           \b, Stereo
  827. >3      byte&0xC0       0x40           \b, JntStereo
  828. >3      byte&0xC0       0x80           \b, 2x Monaural
  829. >3      byte&0xC0       0xC0           \b, Monaural
  830. #>1     byte            ^0x01          \b, Data Verify
  831. #>2     byte            &0x02          \b, Packet Pad
  832. #>2     byte            &0x01          \b, Custom Flag
  833. #>3     byte            &0x08          \b, Copyrighted
  834. #>3     byte            &0x04          \b, Original Source
  835. #>3     byte&0x03       1              \b, NR: 50/15 ms
  836. #>3     byte&0x03       3              \b, NR: CCIT J.17
  837.  
  838. # AAC (aka MPEG-2 NBC audio) and MPEG-4 audio
  839.  
  840. # Stored AAC streams (instead of the MP4 format)
  841. 0       string          ADIF           MPEG ADIF, AAC
  842. !:mime    audio/x-hx-aac-adif
  843. >4      byte            &0x80
  844. >>13    byte            &0x10          \b, VBR
  845. >>13    byte            ^0x10          \b, CBR
  846. >>16    byte&0x1E       0x02           \b, single stream
  847. >>16    byte&0x1E       0x04           \b, 2 streams
  848. >>16    byte&0x1E       0x06           \b, 3 streams
  849. >>16    byte            &0x08          \b, 4 or more streams
  850. >>16    byte            &0x10          \b, 8 or more streams
  851. >>4    byte            &0x80          \b, Copyrighted
  852. >>13   byte            &0x40          \b, Original Source
  853. >>13   byte            &0x20          \b, Home Flag
  854. >4      byte            ^0x80
  855. >>4     byte            &0x10          \b, VBR
  856. >>4     byte            ^0x10          \b, CBR
  857. >>7     byte&0x1E       0x02           \b, single stream
  858. >>7     byte&0x1E       0x04           \b, 2 streams
  859. >>7     byte&0x1E       0x06           \b, 3 streams
  860. >>7     byte            &0x08          \b, 4 or more streams
  861. >>7     byte            &0x10          \b, 8 or more streams
  862. >>4    byte            &0x40          \b, Original Stream(s)
  863. >>4    byte            &0x20          \b, Home Source
  864.  
  865. # Live or stored single AAC stream (used with MPEG-2 systems)
  866. 0       beshort&0xFFF6  0xFFF0         MPEG ADTS, AAC
  867. !:mime    audio/x-hx-aac-adts
  868. >1      byte            &0x08          \b, v2
  869. >1      byte            ^0x08          \b, v4
  870. # profile
  871. >>2     byte            &0xC0          \b LTP
  872. >2      byte&0xc0       0x00           \b Main
  873. >2      byte&0xc0       0x40           \b LC
  874. >2      byte&0xc0       0x80           \b SSR
  875. # timing
  876. >2      byte&0x3c       0x00           \b, 96 kHz
  877. >2      byte&0x3c       0x04           \b, 88.2 kHz
  878. >2      byte&0x3c       0x08           \b, 64 kHz
  879. >2      byte&0x3c       0x0c           \b, 48 kHz
  880. >2      byte&0x3c       0x10           \b, 44.1 kHz
  881. >2      byte&0x3c       0x14           \b, 32 kHz
  882. >2      byte&0x3c       0x18           \b, 24 kHz
  883. >2      byte&0x3c       0x1c           \b, 22.05 kHz
  884. >2      byte&0x3c       0x20           \b, 16 kHz
  885. >2      byte&0x3c       0x24           \b, 12 kHz
  886. >2      byte&0x3c       0x28           \b, 11.025 kHz
  887. >2      byte&0x3c       0x2c           \b, 8 kHz
  888. # channels
  889. >2      beshort&0x01c0  0x0040         \b, monaural
  890. >2      beshort&0x01c0  0x0080         \b, stereo
  891. >2      beshort&0x01c0  0x00c0         \b, stereo + center
  892. >2      beshort&0x01c0  0x0100         \b, stereo+center+LFE
  893. >2      beshort&0x01c0  0x0140         \b, surround
  894. >2      beshort&0x01c0  0x0180         \b, surround + LFE
  895. >2      beshort         &0x01C0        \b, surround + side
  896. #>1     byte            ^0x01           \b, Data Verify
  897. #>2     byte            &0x02           \b, Custom Flag
  898. #>3     byte            &0x20           \b, Original Stream
  899. #>3     byte            &0x10           \b, Home Source
  900. #>3     byte            &0x08           \b, Copyrighted
  901.  
  902. # Live MPEG-4 audio streams (instead of RTP FlexMux)
  903. 0       beshort&0xFFE0  0x56E0         MPEG-4 LOAS
  904. !:mime    audio/x-mp4a-latm
  905. #>1     beshort&0x1FFF  x              \b, %u byte packet
  906. >3      byte&0xE0       0x40
  907. >>4     byte&0x3C       0x04           \b, single stream
  908. >>4     byte&0x3C       0x08           \b, 2 streams
  909. >>4     byte&0x3C       0x0C           \b, 3 streams
  910. >>4     byte            &0x08          \b, 4 or more streams
  911. >>4     byte            &0x20          \b, 8 or more streams
  912. >3      byte&0xC0       0
  913. >>4     byte&0x78       0x08           \b, single stream
  914. >>4     byte&0x78       0x10           \b, 2 streams
  915. >>4     byte&0x78       0x18           \b, 3 streams
  916. >>4     byte            &0x20          \b, 4 or more streams
  917. >>4     byte            &0x40          \b, 8 or more streams
  918. # This magic isn't strong enough (matches plausible ISO-8859-1 text)
  919. #0       beshort         0x4DE1         MPEG-4 LO-EP audio stream
  920. #!:mime    audio/x-mp4a-latm
  921.  
  922. # Summary: FLI animation format
  923. # Created by: Daniel Quinlan <quinlan@yggdrasil.com>
  924. # Modified by (1): Abel Cheung <abelcheung@gmail.com> (avoid over-generic detection)
  925. 4    leshort        0xAF11
  926. # standard FLI always has 320x200 resolution and 8 bit color
  927. >8    leshort        320
  928. >>10    leshort        200
  929. >>>12    leshort        8            FLI animation, 320x200x8
  930. !:mime    video/x-fli
  931. >>>>6    leshort        x            \b, %d frames
  932. # frame speed is multiple of 1/70s
  933. >>>>16    leshort        x            \b, %d/70s per frame
  934.  
  935. # Summary: FLC animation format
  936. # Created by: Daniel Quinlan <quinlan@yggdrasil.com>
  937. # Modified by (1): Abel Cheung <abelcheung@gmail.com> (avoid over-generic detection)
  938. 4    leshort        0xAF12
  939. # standard FLC always use 8 bit color
  940. >12    leshort        8            FLC animation
  941. !:mime    video/x-flc
  942. >>8    leshort        x            \b, %d
  943. >>10    leshort        x            \bx%dx8
  944. >>6    uleshort    x            \b, %d frames
  945. >>16    uleshort    x            \b, %dms per frame
  946.  
  947. # DL animation format
  948. # XXX - collision with most `mips' magic
  949. #
  950. # I couldn't find a real magic number for these, however, this
  951. # -appears- to work.  Note that it might catch other files, too, so be
  952. # careful!
  953. #
  954. # Note that title and author appear in the two 20-byte chunks
  955. # at decimal offsets 2 and 22, respectively, but they are XOR'ed with
  956. # 255 (hex FF)!  The DL format is really bad.
  957. #
  958. #0    byte    1    DL version 1, medium format (160x100, 4 images/screen)
  959. #!:mime    video/x-unknown
  960. #>42    byte    x    - %d screens,
  961. #>43    byte    x    %d commands
  962. #0    byte    2    DL version 2
  963. #!:mime    video/x-unknown
  964. #>1    byte    1    - large format (320x200,1 image/screen),
  965. #>1    byte    2    - medium format (160x100,4 images/screen),
  966. #>1    byte    >2    - unknown format,
  967. #>42    byte    x    %d screens,
  968. #>43    byte    x    %d commands
  969. # Based on empirical evidence, DL version 3 have several nulls following the
  970. # \003.  Most of them start with non-null values at hex offset 0x34 or so.
  971. #0    string    \3\0\0\0\0\0\0\0\0\0\0\0    DL version 3
  972.  
  973. # iso 13818 transport stream
  974. #
  975. # from Oskar Schirmer <schirmer@scara.com> Feb 3, 2001 (ISO 13818.1)
  976. # (the following is a little bit restrictive and works fine for a stream
  977. #  that starts with PAT properly. it won't work for stream data, that is
  978. #  cut from an input device data right in the middle, but this shouldn't
  979. #  disturb)
  980. # syncbyte      8 bit    0x47
  981. # error_ind     1 bit    -
  982. # payload_start 1 bit    1
  983. # priority      1 bit    -
  984. # PID          13 bit    0x0000
  985. # scrambling    2 bit    -
  986. # adaptfld_ctrl 2 bit    1 or 3
  987. # conti_count   4 bit    0
  988. 0    belong&0xFF5FFF1F    0x47400010    MPEG transport stream data
  989. >188    byte            !0x47        CORRUPTED
  990.  
  991. # DIF digital video file format <mpruett@sgi.com>
  992. 0    belong&0xffffff00    0x1f070000      DIF
  993. >4    byte            &0x01        (DVCPRO) movie file
  994. >4    byte            ^0x01        (DV) movie file
  995. >3    byte            &0x80        (PAL)
  996. >3    byte            ^0x80        (NTSC)
  997.  
  998. # Microsoft Advanced Streaming Format (ASF) <mpruett@sgi.com>
  999. 0    belong            0x3026b275    Microsoft ASF
  1000. !:mime    video/x-ms-asf
  1001.  
  1002. # MNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
  1003. 0    string            \x8aMNG        MNG video data,
  1004. !:mime    video/x-mng
  1005. >4    belong            !0x0d0a1a0a    CORRUPTED,
  1006. >4    belong            0x0d0a1a0a
  1007. >>16    belong    x                %ld x
  1008. >>20    belong    x                %ld
  1009.  
  1010. # JNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
  1011. 0    string            \x8bJNG        JNG video data,
  1012. !:mime    video/x-jng
  1013. >4    belong            !0x0d0a1a0a    CORRUPTED,
  1014. >4    belong            0x0d0a1a0a
  1015. >>16    belong    x                %ld x
  1016. >>20    belong    x                %ld
  1017.  
  1018. # Vivo video (Wolfram Kleff)
  1019. 3    string        \x0D\x0AVersion:Vivo    Vivo video data
  1020.  
  1021. # VRML (Virtual Reality Modelling Language)
  1022. 0       string/b        #VRML\ V1.0\ ascii    VRML 1 file
  1023. !:mime    model/vrml
  1024. 0    string/b    #VRML\ V2.0\ utf8    ISO/IEC 14772 VRML 97 file
  1025. !:mime    model/vrml
  1026.  
  1027. # X3D (Extensible 3D) [http://www.web3d.org/specifications/x3d-3.0.dtd]
  1028. # From Michel Briand <michelbriand@free.fr>
  1029. 0    string        \<?xml\ version="
  1030. !:strength +1
  1031. >20    search/1000/cb  \<!DOCTYPE\ X3D        X3D (Extensible 3D) model xml text
  1032. !:mime model/x3d
  1033.  
  1034. #---------------------------------------------------------------------------
  1035. # HVQM4: compressed movie format designed by Hudson for Nintendo GameCube
  1036. # From Mark Sheppard <msheppard@climax.co.uk>, 2002-10-03
  1037. #
  1038. 0    string        HVQM4        %s
  1039. >6    string        >\0        v%s
  1040. >0    byte        x        GameCube movie,
  1041. >0x34    ubeshort    x        %d x
  1042. >0x36    ubeshort    x        %d,
  1043. >0x26    ubeshort    x        %dµs,
  1044. >0x42    ubeshort    0        no audio
  1045. >0x42    ubeshort    >0        %dHz audio
  1046.  
  1047. # From: "Stefan A. Haubenthal" <polluks@web.de>
  1048. 0    string        DVDVIDEO-VTS    Video title set,
  1049. >0x21    byte        x        v%x
  1050. 0    string        DVDVIDEO-VMG    Video manager,
  1051. >0x21    byte        x        v%x
  1052.  
  1053. # From: Behan Webster <behanw@websterwood.com>
  1054. # NuppelVideo used by Mythtv (*.nuv)
  1055. # Note: there are two identical stanzas here differing only in the
  1056. # initial string matched. It used to be done with a regex, but we're
  1057. # trying to get rid of those.
  1058. 0    string        NuppelVideo    MythTV NuppelVideo
  1059. >12    string        x        v%s
  1060. >20    lelong        x        (%d
  1061. >24    lelong        x        \bx%d),
  1062. >36    string        P        \bprogressive,
  1063. >36    string        I        \binterlaced,
  1064. >40    ledouble    x        \baspect:%.2f,
  1065. >48    ledouble    x        \bfps:%.2f
  1066. 0    string        MythTV        MythTV NuppelVideo
  1067. >12    string        x        v%s
  1068. >20    lelong        x        (%d
  1069. >24    lelong        x        \bx%d),
  1070. >36    string        P        \bprogressive,
  1071. >36    string        I        \binterlaced,
  1072. >40    ledouble    x        \baspect:%.2f,
  1073. >48    ledouble    x        \bfps:%.2f
  1074.  
  1075. #                        MPEG file
  1076. # MPEG sequences
  1077. # FIXME: This section is from the old magic.mime file and needs integrating with the rest
  1078. 0       belong             0x000001BA
  1079. >4      byte               &0x40
  1080. !:mime    video/mp2p
  1081. >4      byte               ^0x40
  1082. !:mime    video/mpeg
  1083. 0       belong             0x000001BB
  1084. !:mime    video/mpeg
  1085. 0       belong             0x000001B0
  1086. !:mime    video/mp4v-es
  1087. 0       belong             0x000001B5
  1088. !:mime    video/mp4v-es
  1089. 0       belong             0x000001B3
  1090. !:mime    video/mpv
  1091. 0       belong&0xFF5FFF1F  0x47400010
  1092. !:mime    video/mp2t
  1093. 0       belong             0x00000001
  1094. >4      byte&0x1F       0x07
  1095. !:mime    video/h264
  1096.  
  1097. #------------------------------------------------------------------------------
  1098. # apl:  file(1) magic for APL (see also "pdp" and "vax" for other APL
  1099. #       workspaces)
  1100. #
  1101. 0    long        0100554        APL workspace (Ken's original?)
  1102. #------------------------------------------------------------------------------
  1103. # apple:  file(1) magic for Apple file formats
  1104. #
  1105. 0    search/1    FiLeStArTfIlEsTaRt    binscii (apple ][) text
  1106. 0    string        \x0aGL            Binary II (apple ][) data
  1107. 0    string        \x76\xff        Squeezed (apple ][) data
  1108. 0    string        NuFile            NuFile archive (apple ][) data
  1109. 0    string        N\xf5F\xe9l\xe5        NuFile archive (apple ][) data
  1110. 0    belong        0x00051600        AppleSingle encoded Macintosh file
  1111. 0    belong        0x00051607        AppleDouble encoded Macintosh file
  1112.  
  1113. # Type: Apple Emulator 2IMG format
  1114. # From: Radek Vokal <rvokal@redhat.com>
  1115. 0    string        2IMG    Apple ][ 2IMG Disk Image
  1116. >4    string        XGS!    \b, XGS
  1117. >4    string        CTKG    \b, Catakig
  1118. >4    string        ShIm    \b, Sheppy's ImageMaker
  1119. >4    string        WOOF    \b, Sweet 16
  1120. >4    string        B2TR    \b, Bernie ][ the Rescue
  1121. >4    string        !nfc    \b, ASIMOV2
  1122. >4    string        x    \b, Unknown Format
  1123. >0xc    byte        00    \b, DOS 3.3 sector order
  1124. >>0x10    byte        00    \b, Volume 254
  1125. >>0x10    byte&0x7f    x    \b, Volume %u
  1126. >0xc    byte        01    \b, ProDOS sector order
  1127. >>0x14    short        x    \b, %u Blocks
  1128. >0xc    byte        02    \b, NIB data
  1129.  
  1130. # magic for Newton PDA package formats
  1131. # from Ruda Moura <ruda@helllabs.org>
  1132. 0    string    package0    Newton package, NOS 1.x,
  1133. >12    belong    &0x80000000    AutoRemove,
  1134. >12    belong    &0x40000000    CopyProtect,
  1135. >12    belong    &0x10000000    NoCompression,
  1136. >12    belong    &0x04000000    Relocation,
  1137. >12    belong    &0x02000000    UseFasterCompression,
  1138. >16    belong    x        version %d
  1139.  
  1140. 0    string    package1    Newton package, NOS 2.x,
  1141. >12    belong    &0x80000000    AutoRemove,
  1142. >12    belong    &0x40000000    CopyProtect,
  1143. >12    belong    &0x10000000    NoCompression,
  1144. >12    belong    &0x04000000    Relocation,
  1145. >12    belong    &0x02000000    UseFasterCompression,
  1146. >16    belong    x        version %d
  1147.  
  1148. 0    string    package4    Newton package,
  1149. >8    byte    8        NOS 1.x,
  1150. >8    byte    9        NOS 2.x,
  1151. >12    belong    &0x80000000    AutoRemove,
  1152. >12    belong    &0x40000000    CopyProtect,
  1153. >12    belong    &0x10000000    NoCompression,
  1154.  
  1155. # The following entries for the Apple II are for files that have
  1156. # been transferred as raw binary data from an Apple, without having
  1157. # been encapsulated by any of the above archivers.
  1158. #
  1159. # In general, Apple II formats are hard to identify because Apple DOS
  1160. # and especially Apple ProDOS have strong typing in the file system and
  1161. # therefore programmers never felt much need to include type information
  1162. # in the files themselves.
  1163. #
  1164. # Eric Fischer <enf@pobox.com>
  1165.  
  1166. # AppleWorks word processor:
  1167. #
  1168. # This matches the standard tab stops for an AppleWorks file, but if
  1169. # a file has a tab stop set in the first four columns this will fail.
  1170. #
  1171. # The "O" is really the magic number, but that's so common that it's
  1172. # necessary to check the tab stops that follow it to avoid false positives.
  1173.  
  1174. 4       string          O====   AppleWorks word processor data
  1175. >85     byte&0x01       >0      \b, zoomed
  1176. >90     byte&0x01       >0      \b, paginated
  1177. >92     byte&0x01       >0      \b, with mail merge
  1178. #>91    byte            x       \b, left margin %d
  1179.  
  1180. # AppleWorks database:
  1181. #
  1182. # This isn't really a magic number, but it's the closest thing to one
  1183. # that I could find.  The 1 and 2 really mean "order in which you defined
  1184. # categories" and "left to right, top to bottom," respectively; the D and R
  1185. # mean that the cursor should move either down or right when you press Return.
  1186.  
  1187. #30    string        \x01D    AppleWorks database data
  1188. #30    string        \x02D    AppleWorks database data
  1189. #30    string        \x01R    AppleWorks database data
  1190. #30    string        \x02R    AppleWorks database data
  1191.  
  1192. # AppleWorks spreadsheet:
  1193. #
  1194. # Likewise, this isn't really meant as a magic number.  The R or C means
  1195. # row- or column-order recalculation; the A or M means automatic or manual
  1196. # recalculation.
  1197.  
  1198. #131    string        RA    AppleWorks spreadsheet data
  1199. #131    string        RM    AppleWorks spreadsheet data
  1200. #131    string        CA    AppleWorks spreadsheet data
  1201. #131    string        CM    AppleWorks spreadsheet data
  1202.  
  1203. # Applesoft BASIC:
  1204. #
  1205. # This is incredibly sloppy, but will be true if the program was
  1206. # written at its usual memory location of 2048 and its first line
  1207. # number is less than 256.  Yuck.
  1208.  
  1209. 0       belong&0xff00ff 0x80000 Applesoft BASIC program data
  1210. #>2     leshort         x       \b, first line number %d
  1211.  
  1212. # ORCA/EZ assembler:
  1213. # This will not identify ORCA/M source files, since those have
  1214. # some sort of date code instead of the two zero bytes at 6 and 7
  1215. # XXX Conflicts with ELF
  1216. #4       belong&0xff00ffff       0x01000000      ORCA/EZ assembler source data
  1217. #>5      byte                    x               \b, build number %d
  1218.  
  1219. # Broderbund Fantavision
  1220. #
  1221. # I don't know what these values really mean, but they seem to recur.
  1222. # Will they cause too many conflicts?
  1223.  
  1224. # Probably :-)
  1225. #2    belong&0xFF00FF        0x040008    Fantavision movie data
  1226.  
  1227. # Some attempts at images.
  1228. #
  1229. # These are actually just bit-for-bit dumps of the frame buffer, so
  1230. # there's really no reasonably way to distinguish them except for their
  1231. # address (if preserved) -- 8192 or 16384 -- and their length -- 8192
  1232. # or, occasionally, 8184.
  1233. #
  1234. # Nevertheless this will manage to catch a lot of images that happen
  1235. # to have a solid-colored line at the bottom of the screen.
  1236.  
  1237. # GRR: Magic too weak
  1238. #8144    string    \x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F    Apple II image with white background
  1239. #8144    string    \x55\x2A\x55\x2A\x55\x2A\x55\x2A    Apple II image with purple background
  1240. #8144    string    \x2A\x55\x2A\x55\x2A\x55\x2A\x55    Apple II image with green background
  1241. #8144    string    \xD5\xAA\xD5\xAA\xD5\xAA\xD5\xAA    Apple II image with blue background
  1242. #8144    string    \xAA\xD5\xAA\xD5\xAA\xD5\xAA\xD5    Apple II image with orange background
  1243.  
  1244. # Beagle Bros. Apple Mechanic fonts
  1245.  
  1246. 0    belong&0xFF00FFFF    0x6400D000    Apple Mechanic font
  1247.  
  1248. # Apple Universal Disk Image Format (UDIF) - dmg files.
  1249. # From Johan Gade.
  1250. # These entries are disabled for now until we fix the following issues.
  1251. #
  1252. # Note there might be some problems with the "VAX COFF executable" 
  1253. # entry. Note this entry should be placed before the mac filesystem section, 
  1254. # particularly the "Apple Partition data" entry.
  1255. #
  1256. # The intended meaning of these tests is, that the file is only of the 
  1257. # specified type if both of the lines are correct - i.e. if the first
  1258. # line matches and the second doesn't then it is not of that type.
  1259. #
  1260. #0    long    0x7801730d
  1261. #>4    long    0x62626060    UDIF read-only zlib-compressed image (UDZO)
  1262. #
  1263. # Note that this entry is recognized correctly by the "Apple Partition 
  1264. # data" entry - however since this entry is more specific - this
  1265. # information seems to be more useful.
  1266. #0    long    0x45520200
  1267. #>0x410    string    disk\ image    UDIF read/write image (UDRW)
  1268.  
  1269. # From: Toby Peterson <toby@apple.com>
  1270. 0    string    bplist00    Apple binary property list
  1271.  
  1272. # Apple binary property list (bplist)
  1273. #  Assumes version bytes are hex.
  1274. #  Provides content hints for version 0 files. Assumes that the root
  1275. #  object is the first object (true for CoreFoundation implementation).
  1276. # From: David Remahl <dremahl@apple.com>
  1277. 0        string    bplist
  1278. >6        byte    x    \bCoreFoundation binary property list data, version 0x%c
  1279. >>7        byte    x    \b%c
  1280. >6        string        00        \b
  1281. >>8        byte&0xF0    0x00    \b
  1282. >>>8    byte&0x0F    0x00    \b, root type: null
  1283. >>>8    byte&0x0F    0x08    \b, root type: false boolean
  1284. >>>8    byte&0x0F    0x09    \b, root type: true boolean
  1285. >>8        byte&0xF0    0x10    \b, root type: integer
  1286. >>8        byte&0xF0    0x20    \b, root type: real
  1287. >>8        byte&0xF0    0x30    \b, root type: date
  1288. >>8        byte&0xF0    0x40    \b, root type: data
  1289. >>8        byte&0xF0    0x50    \b, root type: ascii string
  1290. >>8        byte&0xF0    0x60    \b, root type: unicode string
  1291. >>8        byte&0xF0    0x80    \b, root type: uid (CORRUPT)
  1292. >>8        byte&0xF0    0xa0    \b, root type: array
  1293. >>8        byte&0xF0    0xd0    \b, root type: dictionary
  1294.  
  1295. # Apple/NeXT typedstream data
  1296. #  Serialization format used by NeXT and Apple for various
  1297. #  purposes in YellowStep/Cocoa, including some nib files.
  1298. # From: David Remahl <dremahl@apple.com>
  1299. 2        string        typedstream    NeXT/Apple typedstream data, big endian
  1300. >0        byte        x        \b, version %hhd
  1301. >0        byte        <5        \b
  1302. >>13    byte        0x81    \b
  1303. >>>14    ubeshort    x        \b, system %hd
  1304. 2        string        streamtyped NeXT/Apple typedstream data, little endian
  1305. >0        byte        x        \b, version %hhd
  1306. >0        byte        <5        \b
  1307. >>13    byte        0x81    \b
  1308. >>>14    uleshort    x        \b, system %hd
  1309.  
  1310. #------------------------------------------------------------------------------
  1311. # CAF: Apple CoreAudio File Format
  1312. #
  1313. # Container format for high-end audio purposes.
  1314. # From: David Remahl <dremahl@apple.com>
  1315. #
  1316. 0    string        caff        CoreAudio Format audio file
  1317. >4    beshort        <10        version %d
  1318. >6    beshort        x
  1319.  
  1320.  
  1321. #------------------------------------------------------------------------------
  1322. # Keychain database files
  1323. 0    string        kych        Mac OS X Keychain File
  1324.  
  1325. #------------------------------------------------------------------------------
  1326. # Code Signing related file types
  1327. 0    belong        0xfade0c00    Mac OS X Code Requirement
  1328. >8    belong        1            (opExpr)
  1329. >4    belong        x            - %d bytes
  1330.  
  1331. 0    belong        0xfade0c01    Mac OS X Code Requirement Set
  1332. >8    belong        >1            containing %d items
  1333. >4    belong        x            - %d bytes
  1334.  
  1335. 0    belong        0xfade0c02    Mac OS X Code Directory
  1336. >8    belong        x            version %x
  1337. >12    belong        >0            flags 0x%x
  1338. >4    belong        x            - %d bytes
  1339.  
  1340. 0    belong        0xfade0cc0    Mac OS X Detached Code Signature (non-executable)
  1341. >4    belong        x            - %d bytes
  1342.  
  1343. 0    belong        0xfade0cc1    Mac OS X Detached Code Signature
  1344. >8    belong        >1            (%d elements)
  1345. >4    belong        x            - %d bytes
  1346.  
  1347. # From: "Nelson A. de Oliveira" <naoliv@gmail.com>
  1348. # .vdi
  1349. 4    string innotek\ VirtualBox\ Disk\ Image %s
  1350.  
  1351. #------------------------------------------------------------------------------
  1352. # applix:  file(1) magic for Applixware
  1353. # From: Peter Soos <sp@osb.hu>
  1354. #
  1355. 0    string        *BEGIN        Applixware
  1356. >7    string        WORDS            Words Document
  1357. >7    string        GRAPHICS        Graphic
  1358. >7    string        RASTER            Bitmap
  1359. >7    string        SPREADSHEETS        Spreadsheet
  1360. >7    string        MACRO            Macro
  1361. >7    string        BUILDER            Builder Object
  1362. #------------------------------------------------------------------------------
  1363. # archive:  file(1) magic for archive formats (see also "msdos" for self-
  1364. #           extracting compressed archives)
  1365. #
  1366. # cpio, ar, arc, arj, hpack, lha/lharc, rar, squish, uc2, zip, zoo, etc.
  1367. # pre-POSIX "tar" archives are handled in the C code.
  1368.  
  1369. # POSIX tar archives
  1370. 257    string        ustar\0        POSIX tar archive
  1371. !:mime    application/x-tar # encoding: posix
  1372. 257    string        ustar\040\040\0    GNU tar archive
  1373. !:mime    application/x-tar # encoding: gnu
  1374.  
  1375. # cpio archives
  1376. #
  1377. # Yes, the top two "cpio archive" formats *are* supposed to just be "short".
  1378. # The idea is to indicate archives produced on machines with the same
  1379. # byte order as the machine running "file" with "cpio archive", and
  1380. # to indicate archives produced on machines with the opposite byte order
  1381. # from the machine running "file" with "byte-swapped cpio archive".
  1382. #
  1383. # The SVR4 "cpio(4)" hints that there are additional formats, but they
  1384. # are defined as "short"s; I think all the new formats are
  1385. # character-header formats and thus are strings, not numbers.
  1386. 0    short        070707        cpio archive
  1387. !:mime    application/x-cpio
  1388. 0    short        0143561        byte-swapped cpio archive
  1389. !:mime    application/x-cpio # encoding: swapped
  1390. 0    string        070707        ASCII cpio archive (pre-SVR4 or odc)
  1391. 0    string        070701        ASCII cpio archive (SVR4 with no CRC)
  1392. 0    string        070702        ASCII cpio archive (SVR4 with CRC)
  1393.  
  1394. # Debian package (needs to go before regular portable archives)
  1395. #
  1396. 0    string        =!<arch>\ndebian
  1397. !:mime    application/x-debian-package
  1398. >8    string        debian-split    part of multipart Debian package
  1399. >8    string        debian-binary    Debian binary package
  1400. >8    string        !debian
  1401. >68    string        >\0        (format %s)
  1402. # These next two lines do not work, because a bzip2 Debian archive
  1403. # still uses gzip for the control.tar (first in the archive).  Only
  1404. # data.tar varies, and the location of its filename varies too.
  1405. # file/libmagic does not current have support for ascii-string based
  1406. # (offsets) as of 2005-09-15.
  1407. #>81    string        bz2        \b, uses bzip2 compression
  1408. #>84    string        gz        \b, uses gzip compression
  1409. #>136    ledate        x        created: %s
  1410.  
  1411. # other archives
  1412. 0    long        0177555        very old archive
  1413. 0    short        0177555        very old PDP-11 archive
  1414. 0    long        0177545        old archive
  1415. 0    short        0177545        old PDP-11 archive
  1416. 0    long        0100554        apl workspace
  1417. 0    string        =<ar>        archive
  1418. !:mime    application/x-archive
  1419.  
  1420. # MIPS archive (needs to go before regular portable archives)
  1421. #
  1422. 0    string    =!<arch>\n__________E    MIPS archive
  1423. >20    string    U            with MIPS Ucode members
  1424. >21    string    L            with MIPSEL members
  1425. >21    string    B            with MIPSEB members
  1426. >19    string    L            and an EL hash table
  1427. >19    string    B            and an EB hash table
  1428. >22    string    X            -- out of date
  1429.  
  1430. 0    search/1    -h-        Software Tools format archive text
  1431.  
  1432. #
  1433. # XXX - why are there multiple <ar> thingies?  Note that 0x213c6172 is
  1434. # "!<ar", so, for new-style (4.xBSD/SVR2andup) archives, we have:
  1435. #
  1436. # 0    string        =!<arch>        current ar archive
  1437. # 0    long        0x213c6172    archive file
  1438. #
  1439. # and for SVR1 archives, we have:
  1440. #
  1441. # 0    string        \<ar>        System V Release 1 ar archive
  1442. # 0    string        =<ar>        archive
  1443. #
  1444. # XXX - did Aegis really store shared libraries, breakpointed modules,
  1445. # and absolute code program modules in the same format as new-style
  1446. # "ar" archives?
  1447. #
  1448. 0    string        =!<arch>        current ar archive
  1449. !:mime    application/x-archive
  1450. >8    string        __.SYMDEF    random library
  1451. >0    belong        =65538        - pre SR9.5
  1452. >0    belong        =65539        - post SR9.5
  1453. >0    beshort        2        - object archive
  1454. >0    beshort        3        - shared library module
  1455. >0    beshort        4        - debug break-pointed module
  1456. >0    beshort        5        - absolute code program module
  1457. 0    string        \<ar>        System V Release 1 ar archive
  1458. 0    string        =<ar>        archive
  1459. #
  1460. # XXX - from "vax", which appears to collect a bunch of byte-swapped
  1461. # thingies, to help you recognize VAX files on big-endian machines;
  1462. # with "leshort", "lelong", and "string", that's no longer necessary....
  1463. #
  1464. 0    belong        0x65ff0000    VAX 3.0 archive
  1465. 0    belong        0x3c61723e    VAX 5.0 archive
  1466. #
  1467. 0    long        0x213c6172    archive file
  1468. 0    lelong        0177555        very old VAX archive
  1469. 0    leshort        0177555        very old PDP-11 archive
  1470. #
  1471. # XXX - "pdp" claims that 0177545 can have an __.SYMDEF member and thus
  1472. # be a random library (it said 0xff65 rather than 0177545).
  1473. #
  1474. 0    lelong        0177545        old VAX archive
  1475. >8    string        __.SYMDEF    random library
  1476. 0    leshort        0177545        old PDP-11 archive
  1477. >8    string        __.SYMDEF    random library
  1478. #
  1479. # From "pdp" (but why a 4-byte quantity?)
  1480. #
  1481. 0    lelong        0x39bed        PDP-11 old archive
  1482. 0    lelong        0x39bee        PDP-11 4.0 archive
  1483.  
  1484. # ARC archiver, from Daniel Quinlan (quinlan@yggdrasil.com)
  1485. #
  1486. # The first byte is the magic (0x1a), byte 2 is the compression type for
  1487. # the first file (0x01 through 0x09), and bytes 3 to 15 are the MS-DOS
  1488. # filename of the first file (null terminated).  Since some types collide
  1489. # we only test some types on basis of frequency: 0x08 (83%), 0x09 (5%),
  1490. # 0x02 (5%), 0x03 (3%), 0x04 (2%), 0x06 (2%).  0x01 collides with terminfo.
  1491. 0    lelong&0x8080ffff    0x0000081a    ARC archive data, dynamic LZW
  1492. !:mime    application/x-arc
  1493. 0    lelong&0x8080ffff    0x0000091a    ARC archive data, squashed
  1494. !:mime    application/x-arc
  1495. 0    lelong&0x8080ffff    0x0000021a    ARC archive data, uncompressed
  1496. !:mime    application/x-arc
  1497. 0    lelong&0x8080ffff    0x0000031a    ARC archive data, packed
  1498. !:mime    application/x-arc
  1499. 0    lelong&0x8080ffff    0x0000041a    ARC archive data, squeezed
  1500. !:mime    application/x-arc
  1501. 0    lelong&0x8080ffff    0x0000061a    ARC archive data, crunched
  1502. !:mime    application/x-arc
  1503. # [JW] stuff taken from idarc, obviously ARC successors:
  1504. 0    lelong&0x8080ffff    0x00000a1a    PAK archive data
  1505. !:mime    application/x-arc
  1506. 0    lelong&0x8080ffff    0x0000141a    ARC+ archive data
  1507. !:mime    application/x-arc
  1508. 0    lelong&0x8080ffff    0x0000481a    HYP archive data
  1509. !:mime    application/x-arc
  1510.  
  1511. # Acorn archive formats (Disaster prone simpleton, m91dps@ecs.ox.ac.uk)
  1512. # I can't create either SPARK or ArcFS archives so I have not tested this stuff
  1513. # [GRR:  the original entries collide with ARC, above; replaced with combined
  1514. #  version (not tested)]
  1515. #0    byte        0x1a        RISC OS archive (spark format)
  1516. 0    string        \032archive    RISC OS archive (ArcFS format)
  1517. 0       string          Archive\000     RISC OS archive (ArcFS format)
  1518.  
  1519. # All these were taken from idarc, many could not be verified. Unfortunately,
  1520. # there were many low-quality sigs, i.e. easy to trigger false positives.
  1521. # Please notify me of any real-world fishy/ambiguous signatures and I'll try
  1522. # to get my hands on the actual archiver and see if I find something better. [JW]
  1523. # probably many can be enhanced by finding some 0-byte or control char near the start
  1524.  
  1525. # idarc calls this Crush/Uncompressed... *shrug*
  1526. 0    string    CRUSH Crush archive data
  1527. # Squeeze It (.sqz)
  1528. 0    string    HLSQZ Squeeze It archive data
  1529. # SQWEZ
  1530. 0    string    SQWEZ SQWEZ archive data
  1531. # HPack (.hpk)
  1532. 0    string    HPAK HPack archive data
  1533. # HAP
  1534. 0    string    \x91\x33HF HAP archive data
  1535. # MD/MDCD
  1536. 0    string    MDmd MDCD archive data
  1537. # LIM
  1538. 0    string    LIM\x1a LIM archive data
  1539. # SAR
  1540. 3    string    LH5 SAR archive data
  1541. # BSArc/BS2
  1542. 0    string    \212\3SB \0 BSArc/BS2 archive data
  1543. # MAR
  1544. 2    string    =-ah MAR archive data
  1545. # ACB
  1546. 0    belong&0x00f800ff    0x00800000 ACB archive data
  1547. # CPZ
  1548. # TODO, this is what idarc says: 0    string    \0\0\0 CPZ archive data
  1549. # JRC
  1550. 0    string    JRchive JRC archive data
  1551. # Quantum
  1552. 0    string    DS\0 Quantum archive data
  1553. # ReSOF
  1554. 0    string    PK\3\6 ReSOF archive data
  1555. # QuArk
  1556. 0    string    7\4 QuArk archive data
  1557. # YAC
  1558. 14    string    YC YAC archive data
  1559. # X1
  1560. 0    string    X1 X1 archive data
  1561. 0    string    XhDr X1 archive data
  1562. # CDC Codec (.dqt)
  1563. 0    belong&0xffffe000    0x76ff2000 CDC Codec archive data
  1564. # AMGC
  1565. 0    string    \xad6" AMGC archive data
  1566. # NuLIB
  1567. 0    string    NõFélāˆšā€¢ NuLIB archive data
  1568. # PakLeo
  1569. 0    string    LEOLZW PAKLeo archive data
  1570. # ChArc
  1571. 0    string    SChF ChArc archive data
  1572. # PSA
  1573. 0    string    PSA PSA archive data
  1574. # CrossePAC
  1575. 0    string    DSIGDCC CrossePAC archive data
  1576. # Freeze
  1577. 0    string    \x1f\x9f\x4a\x10\x0a Freeze archive data
  1578. # KBoom
  1579. 0    string    Ā¬Ā®MP¨ KBoom archive data
  1580. # NSQ, must go after CDC Codec
  1581. 0    string    \x76\xff NSQ archive data
  1582. # DPA
  1583. 0    string    Dirk\ Paehl DPA archive data
  1584. # BA
  1585. # TODO: idarc says "bytes 0-2 == bytes 3-5"
  1586. # TTComp
  1587. 0    string    \0\6 TTComp archive data
  1588. # ESP, could this conflict with Easy Software Products' (e.g.ESP ghostscript) documentation?
  1589. 0    string    ESP ESP archive data
  1590. # ZPack
  1591. 0    string    \1ZPK\1 ZPack archive data
  1592. # Sky
  1593. 0    string    \xbc\x40 Sky archive data
  1594. # UFA
  1595. 0    string    UFA UFA archive data
  1596. # Dry
  1597. 0    string    =-H2O DRY archive data
  1598. # FoxSQZ
  1599. 0    string    FOXSQZ FoxSQZ archive data
  1600. # AR7
  1601. 0    string    ,AR7 AR7 archive data
  1602. # PPMZ
  1603. 0    string    PPMZ PPMZ archive data
  1604. # MS Compress
  1605. 4    string    \x88\xf0\x27 MS Compress archive data
  1606. # updated by Joerg Jenderek
  1607. >9    string    \0        
  1608. >>0    string    KWAJ        
  1609. >>>7    string    \321\003    MS Compress archive data
  1610. >>>>14    ulong    >0        \b, original size: %ld bytes
  1611. >>>>18        ubyte    >0x65      
  1612. >>>>>18        string    x        \b, was %.8s
  1613. >>>>>(10.b-4)    string    x        \b.%.3s
  1614. # MP3 (archiver, not lossy audio compression)
  1615. 0    string    MP3\x1a MP3-Archiver archive data
  1616. # ZET
  1617. 0    string    OZ√ù ZET archive data
  1618. # TSComp
  1619. 0    string    \x65\x5d\x13\x8c\x08\x01\x03\x00 TSComp archive data
  1620. # ARQ
  1621. 0    string    gW\4\1 ARQ archive data
  1622. # Squash
  1623. 3    string    OctSqu Squash archive data
  1624. # Terse
  1625. 0    string    \5\1\1\0 Terse archive data
  1626. # PUCrunch
  1627. 0    string    \x01\x08\x0b\x08\xef\x00\x9e\x32\x30\x36\x31 PUCrunch archive data
  1628. # UHarc
  1629. 0    string    UHA UHarc archive data
  1630. # ABComp
  1631. 0    string    \2AB ABComp archive data
  1632. 0    string    \3AB2 ABComp archive data
  1633. # CMP
  1634. 0    string    CO\0 CMP archive data
  1635. # Splint
  1636. 0    string    \x93\xb9\x06 Splint archive data
  1637. # InstallShield
  1638. 0    string     \x13\x5d\x65\x8c InstallShield Z archive Data
  1639. # Gather
  1640. 1    string    GTH Gather archive data
  1641. # BOA
  1642. 0    string    BOA BOA archive data
  1643. # RAX
  1644. 0    string    ULEB\xa RAX archive data
  1645. # Xtreme
  1646. 0    string    ULEB\0 Xtreme archive data
  1647. # Pack Magic
  1648. 0    string    @√¢\1\0 Pack Magic archive data
  1649. # BTS
  1650. 0    belong&0xfeffffff    0x1a034465 BTS archive data
  1651. # ELI 5750
  1652. 0    string    Ora\  ELI 5750 archive data
  1653. # QFC
  1654. 0    string    \x1aFC\x1a QFC archive data
  1655. 0    string    \x1aQF\x1a QFC archive data
  1656. # PRO-PACK
  1657. 0    string    RNC PRO-PACK archive data
  1658. # 777
  1659. 0    string    777 777 archive data
  1660. # LZS221
  1661. 0    string    sTaC LZS221 archive data
  1662. # HPA
  1663. 0    string    HPA HPA archive data
  1664. # Arhangel
  1665. 0    string    LG Arhangel archive data
  1666. # EXP1, uses bzip2
  1667. 0    string    0123456789012345BZh EXP1 archive data
  1668. # IMP
  1669. 0    string    IMP\xa IMP archive data
  1670. # NRV
  1671. 0    string    \x00\x9E\x6E\x72\x76\xFF NRV archive data
  1672. # Squish
  1673. 0    string    \x73\xb2\x90\xf4 Squish archive data
  1674. # Par
  1675. 0    string    PHILIPP Par archive data
  1676. 0    string    PAR Par archive data
  1677. # HIT
  1678. 0    string    UB HIT archive data
  1679. # SBX
  1680. 0    belong&0xfffff000    0x53423000 SBX archive data
  1681. # NaShrink
  1682. 0    string    NSK NaShrink archive data
  1683. # SAPCAR
  1684. 0    string    #\ CAR\ archive\ header SAPCAR archive data
  1685. 0    string    CAR\ 2.00RG SAPCAR archive data
  1686. # Disintegrator
  1687. 0    string    DST Disintegrator archive data
  1688. # ASD
  1689. 0    string    ASD ASD archive data
  1690. # InstallShield CAB
  1691. 0    string    ISc( InstallShield CAB
  1692. # TOP4
  1693. 0    string    T4\x1a TOP4 archive data
  1694. # BatComp left out: sig looks like COM executable
  1695. # so TODO: get real 4dos batcomp file and find sig
  1696. # BlakHole
  1697. 0    string    BH\5\7 BlakHole archive data
  1698. # BIX
  1699. 0    string    BIX0 BIX archive data
  1700. # ChiefLZA
  1701. 0    string    ChfLZ ChiefLZA archive data
  1702. # Blink
  1703. 0    string    Blink Blink archive data
  1704. # Logitech Compress
  1705. 0    string    \xda\xfa Logitech Compress archive data
  1706. # ARS-Sfx (FIXME: really a SFX? then goto COM/EXE)
  1707. 1    string    (C)\ STEPANYUK ARS-Sfx archive data
  1708. # AKT/AKT32
  1709. 0    string    AKT32 AKT32 archive data
  1710. 0    string    AKT AKT archive data
  1711. # NPack
  1712. 0    string    MSTSM NPack archive data
  1713. # PFT
  1714. 0    string    \0\x50\0\x14 PFT archive data
  1715. # SemOne
  1716. 0    string    SEM SemOne archive data
  1717. # PPMD
  1718. 0    string    \x8f\xaf\xac\x84 PPMD archive data
  1719. # FIZ
  1720. 0    string    FIZ FIZ archive data
  1721. # MSXiE
  1722. 0    belong&0xfffff0f0    0x4d530000 MSXiE archive data
  1723. # DeepFreezer
  1724. 0    belong&0xfffffff0    0x797a3030 DeepFreezer archive data
  1725. # DC
  1726. 0    string    =<DC- DC archive data
  1727. # TPac
  1728. 0    string    \4TPAC\3 TPac archive data
  1729. # Ai
  1730. 0    string    Ai\1\1\0 Ai archive data
  1731. 0    string    Ai\1\0\0 Ai archive data
  1732. # Ai32
  1733. 0    string    Ai\2\0 Ai32 archive data
  1734. 0    string    Ai\2\1 Ai32 archive data
  1735. # SBC
  1736. 0    string    SBC SBC archive data
  1737. # Ybs
  1738. 0    string    YBS Ybs archive data
  1739. # DitPack
  1740. 0    string    \x9e\0\0 DitPack archive data
  1741. # DMS
  1742. 0    string    DMS! DMS archive data
  1743. # EPC
  1744. 0    string    \x8f\xaf\xac\x8c EPC archive data
  1745. # VSARC
  1746. 0    string    VS\x1a VSARC archive data
  1747. # PDZ
  1748. 0    string    PDZ PDZ archive data
  1749. # ReDuq
  1750. 0    string    rdqx ReDuq archive data
  1751. # GCA
  1752. 0    string    GCAX GCA archive data
  1753. # PPMN
  1754. 0    string    pN PPMN archive data
  1755. # WinImage
  1756. 3    string    WINIMAGE WinImage archive data
  1757. # Compressia
  1758. 0    string    CMP0CMP Compressia archive data
  1759. # UHBC
  1760. 0    string    UHB UHBC archive data
  1761. # WinHKI
  1762. 0    string    \x61\x5C\x04\x05 WinHKI archive data
  1763. # WWPack data file
  1764. 0    string    WWP WWPack archive data
  1765. # BSN (BSA, PTS-DOS)
  1766. 0    string    \xffBSG BSN archive data
  1767. 1    string    \xffBSG BSN archive data
  1768. 3    string    \xffBSG BSN archive data
  1769. 1    string    \0\xae\2 BSN archive data
  1770. 1    string    \0\xae\3 BSN archive data
  1771. 1    string    \0\xae\7 BSN archive data
  1772. # AIN
  1773. 0    string    \x33\x18 AIN archive data
  1774. 0    string    \x33\x17 AIN archive data
  1775. # XPA32
  1776. 0    string    xpa\0\1 XPA32 archive data
  1777. # SZip (TODO: doesn't catch all versions)
  1778. 0    string    SZ\x0a\4 SZip archive data
  1779. # XPack DiskImage
  1780. 0    string    jm XPack DiskImage archive data
  1781. # XPack Data
  1782. 0    string    xpa XPack archive data
  1783. # XPack Single Data
  1784. 0    string    āˆšĆ§\ jm XPack single archive data
  1785.  
  1786. # TODO: missing due to unknown magic/magic at end of file:
  1787. #DWC
  1788. #ARG
  1789. #ZAR
  1790. #PC/3270
  1791. #InstallIt
  1792. #RKive
  1793. #RK
  1794. #XPack Diskimage
  1795.  
  1796. # These were inspired by idarc, but actually verified
  1797. # Dzip archiver (.dz)
  1798. 0    string    DZ Dzip archive data
  1799. >2    byte    x \b, version %i
  1800. >3    byte    x \b.%i
  1801. # ZZip archiver (.zz)
  1802. 0    string    ZZ\ \0\0 ZZip archive data
  1803. 0    string    ZZ0 ZZip archive data
  1804. # PAQ archiver (.paq)
  1805. 0    string    \xaa\x40\x5f\x77\x1f\xe5\x82\x0d PAQ archive data
  1806. 0    string    PAQ PAQ archive data
  1807. >3    byte&0xf0    0x30
  1808. >>3    byte    x (v%c)
  1809. # JAR archiver (.j), this is the successor to ARJ, not Java's JAR (which is essentially ZIP)
  1810. 0xe    string    \x1aJar\x1b JAR (ARJ Software, Inc.) archive data
  1811. 0    string    JARCS JAR (ARJ Software, Inc.) archive data
  1812.  
  1813. # ARJ archiver (jason@jarthur.Claremont.EDU)
  1814. 0    leshort        0xea60        ARJ archive data
  1815. !:mime    application/x-arj
  1816. >5    byte        x        \b, v%d,
  1817. >8    byte        &0x04        multi-volume,
  1818. >8    byte        &0x10        slash-switched,
  1819. >8    byte        &0x20        backup,
  1820. >34    string        x        original name: %s,
  1821. >7    byte        0        os: MS-DOS
  1822. >7    byte        1        os: PRIMOS
  1823. >7    byte        2        os: Unix
  1824. >7    byte        3        os: Amiga
  1825. >7    byte        4        os: Macintosh
  1826. >7    byte        5        os: OS/2
  1827. >7    byte        6        os: Apple ][ GS
  1828. >7    byte        7        os: Atari ST
  1829. >7    byte        8        os: NeXT
  1830. >7    byte        9        os: VAX/VMS
  1831. >3    byte        >0        %d]
  1832. # [JW] idarc says this is also possible
  1833. 2    leshort        0xea60        ARJ archive data
  1834.  
  1835. # HA archiver (Greg Roelofs, newt@uchicago.edu)
  1836. # This is a really bad format. A file containing HAWAII will match this...
  1837. #0    string        HA        HA archive data,
  1838. #>2    leshort        =1        1 file,
  1839. #>2    leshort        >1        %u files,
  1840. #>4    byte&0x0f    =0        first is type CPY
  1841. #>4    byte&0x0f    =1        first is type ASC
  1842. #>4    byte&0x0f    =2        first is type HSC
  1843. #>4    byte&0x0f    =0x0e        first is type DIR
  1844. #>4    byte&0x0f    =0x0f        first is type SPECIAL
  1845. # suggestion: at least identify small archives (<1024 files)
  1846. 0  belong&0xffff00fc 0x48410000 HA archive data
  1847. >2    leshort        =1        1 file,
  1848. >2    leshort        >1        %u files,
  1849. >4    byte&0x0f    =0        first is type CPY
  1850. >4    byte&0x0f    =1        first is type ASC
  1851. >4    byte&0x0f    =2        first is type HSC
  1852. >4    byte&0x0f    =0x0e        first is type DIR
  1853. >4    byte&0x0f    =0x0f        first is type SPECIAL
  1854.  
  1855. # HPACK archiver (Peter Gutmann, pgut1@cs.aukuni.ac.nz)
  1856. 0    string        HPAK        HPACK archive data
  1857.  
  1858. # JAM Archive volume format, by Dmitry.Kohmanyuk@UA.net
  1859. 0    string        \351,\001JAM\         JAM archive,
  1860. >7    string        >\0            version %.4s
  1861. >0x26    byte        =0x27            -
  1862. >>0x2b    string          >\0            label %.11s,
  1863. >>0x27    lelong        x            serial %08x,
  1864. >>0x36    string        >\0            fstype %.8s
  1865.  
  1866. # LHARC/LHA archiver (Greg Roelofs, newt@uchicago.edu)
  1867. 2    string        -lh0-        LHarc 1.x/ARX archive data [lh0]
  1868. !:mime    application/x-lharc
  1869. 2    string        -lh1-        LHarc 1.x/ARX archive data [lh1]
  1870. !:mime    application/x-lharc
  1871. 2    string        -lz4-        LHarc 1.x archive data [lz4]
  1872. !:mime    application/x-lharc
  1873. 2    string        -lz5-        LHarc 1.x archive data [lz5]
  1874. !:mime    application/x-lharc
  1875. #    [never seen any but the last; -lh4- reported in comp.compression:]
  1876. 2    string        -lzs-        LHa/LZS archive data [lzs]
  1877. !:mime    application/x-lha
  1878. 2    string        -lh\40-        LHa 2.x? archive data [lh ]
  1879. !:mime    application/x-lha
  1880. 2    string        -lhd-        LHa 2.x? archive data [lhd]
  1881. !:mime    application/x-lha
  1882. 2    string        -lh2-        LHa 2.x? archive data [lh2]
  1883. !:mime    application/x-lha
  1884. 2    string        -lh3-        LHa 2.x? archive data [lh3]
  1885. !:mime    application/x-lha
  1886. 2    string        -lh4-        LHa (2.x) archive data [lh4]
  1887. !:mime    application/x-lha
  1888. 2    string        -lh5-        LHa (2.x) archive data [lh5]
  1889. !:mime    application/x-lha
  1890. 2    string        -lh6-        LHa (2.x) archive data [lh6]
  1891. !:mime    application/x-lha
  1892. 2    string        -lh7-        LHa (2.x)/LHark archive data [lh7]
  1893. !:mime    application/x-lha
  1894. >20    byte        x        - header level %d
  1895. # taken from idarc [JW]
  1896. 2   string      -lZ         PUT archive data
  1897. 2   string      -lz         LZS archive data 
  1898. 2   string      -sw1-       Swag archive data
  1899.  
  1900. # RAR archiver (Greg Roelofs, newt@uchicago.edu)
  1901. 0    string        Rar!        RAR archive data,
  1902. !:mime    application/x-rar
  1903. >44    byte        x        v%0x,
  1904. >10    byte        >0        flags:
  1905. >>10    byte        &0x01        Archive volume,
  1906. >>10    byte        &0x02        Commented,
  1907. >>10    byte        &0x04        Locked,
  1908. >>10    byte        &0x08        Solid,
  1909. >>10    byte        &0x20        Authenticated,
  1910. >35    byte        0        os: MS-DOS
  1911. >35    byte        1        os: OS/2
  1912. >35    byte        2        os: Win32
  1913. >35    byte        3        os: Unix
  1914. # some old version? idarc says:
  1915. 0   string      RE\x7e\x5e  RAR archive data
  1916.  
  1917. # SQUISH archiver (Greg Roelofs, newt@uchicago.edu)
  1918. 0    string        SQSH        squished archive data (Acorn RISCOS)
  1919.  
  1920. # UC2 archiver (Greg Roelofs, newt@uchicago.edu)
  1921. # [JW] see exe section for self-extracting version
  1922. 0    string        UC2\x1a        UC2 archive data
  1923.  
  1924. # ZIP archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu)
  1925. 0    string        PK\003\004
  1926. >4    byte        0x00        Zip archive data
  1927. !:mime    application/zip
  1928. >4    byte        0x09        Zip archive data, at least v0.9 to extract
  1929. !:mime    application/zip
  1930. >4    byte        0x0a        Zip archive data, at least v1.0 to extract
  1931. !:mime    application/zip
  1932. >4    byte        0x0b        Zip archive data, at least v1.1 to extract
  1933. !:mime    application/zip
  1934. >0x161    string        WINZIP          Zip archive data, WinZIP self-extracting
  1935. !:mime    application/zip
  1936. >4    byte        0x14
  1937. >>30    ubelong        !0x6d696d65    Zip archive data, at least v2.0 to extract
  1938. !:mime    application/zip
  1939.  
  1940. # OpenOffice.org / KOffice / StarOffice documents
  1941. # Listed here because they ARE zip files
  1942. #
  1943. # From: Abel Cheung <abel@oaka.org>
  1944. >4    byte        0x14
  1945. >>30    string        mimetype
  1946.  
  1947. # KOffice (1.2 or above) formats
  1948. >>>50    string    vnd.kde.        KOffice (>=1.2)
  1949. >>>>58    string    karbon            Karbon document
  1950. >>>>58    string    kchart            KChart document
  1951. >>>>58    string    kformula        KFormula document
  1952. >>>>58    string    kivio            Kivio document
  1953. >>>>58    string    kontour            Kontour document
  1954. >>>>58    string    kpresenter        KPresenter document
  1955. >>>>58    string    kspread            KSpread document
  1956. >>>>58    string    kword            KWord document
  1957.  
  1958. # OpenOffice formats (for OpenOffice 1.x / StarOffice 6/7)
  1959. >>>50    string    vnd.sun.xml.        OpenOffice.org 1.x
  1960. >>>>62    string    writer            Writer
  1961. >>>>>68    byte    !0x2e            document
  1962. >>>>>68    string    .template        template
  1963. >>>>>68    string    .global            global document
  1964. >>>>62    string    calc            Calc
  1965. >>>>>66    byte    !0x2e            spreadsheet
  1966. >>>>>66    string    .template        template
  1967. >>>>62    string    draw            Draw
  1968. >>>>>66    byte    !0x2e            document
  1969. >>>>>66    string    .template        template
  1970. >>>>62    string    impress            Impress
  1971. >>>>>69    byte    !0x2e            presentation
  1972. >>>>>69    string    .template        template
  1973. >>>>62    string    math            Math document
  1974. >>>>62    string    base            Database file
  1975.  
  1976. # OpenDocument formats (for OpenOffice 2.x / StarOffice >= 8)
  1977. # http://lists.oasis-open.org/archives/office/200505/msg00006.html
  1978. >>>50    string    vnd.oasis.opendocument.    OpenDocument
  1979. >>>>73    string    text
  1980. >>>>>77    byte    !0x2d            Text
  1981. !:mime    application/vnd.oasis.opendocument.text
  1982. >>>>>77    string    -template        Text Template
  1983. >>>>>77    string    -web            HTML Document Template
  1984. >>>>>77    string    -master            Master Document
  1985. >>>>73    string    graphics        Drawing
  1986. >>>>>81    string    -template        Template
  1987. >>>>73    string    presentation        Presentation
  1988. >>>>>85    string    -template        Template
  1989. >>>>73    string    spreadsheet        Spreadsheet
  1990. >>>>>84    string    -template        Template
  1991. >>>>73    string    chart            Chart
  1992. >>>>>78    string    -template        Template
  1993. >>>>73    string    formula            Formula
  1994. >>>>>80    string    -template        Template
  1995. >>>>73    string    database        Database
  1996. >>>>73    string    image            Image
  1997.  
  1998. # Zoo archiver
  1999. 20    lelong        0xfdc4a7dc    Zoo archive data
  2000. !:mime    application/x-zoo
  2001. >4    byte        >48        \b, v%c.
  2002. >>6    byte        >47        \b%c
  2003. >>>7    byte        >47        \b%c
  2004. >32    byte        >0        \b, modify: v%d
  2005. >>33    byte        x        \b.%d+
  2006. >42    lelong        0xfdc4a7dc    \b,
  2007. >>70    byte        >0        extract: v%d
  2008. >>>71    byte        x        \b.%d+
  2009.  
  2010. # Shell archives
  2011. 10    string        #\ This\ is\ a\ shell\ archive    shell archive text
  2012. !:mime    application/octet-stream
  2013.  
  2014. #
  2015. # LBR. NB: May conflict with the questionable 
  2016. #          "binary Computer Graphics Metafile" format.
  2017. #
  2018. 0       string  \0\ \ \ \ \ \ \ \ \ \ \ \0\0    LBR archive data
  2019. #
  2020. # PMA (CP/M derivative of LHA)
  2021. #
  2022. 2       string          -pm0-           PMarc archive data [pm0]
  2023. 2       string          -pm1-           PMarc archive data [pm1]
  2024. 2       string          -pm2-           PMarc archive data [pm2]
  2025. 2       string          -pms-           PMarc SFX archive (CP/M, DOS)
  2026. 5       string          -pc1-           PopCom compressed executable (CP/M)
  2027.  
  2028. # From Rafael Laboissiere <rafael@laboissiere.net>
  2029. # The Project Revision Control System (see
  2030. # http://prcs.sourceforge.net) generates a packaged project
  2031. # file which is recognized by the following entry: 
  2032. 0    leshort        0xeb81    PRCS packaged project
  2033.  
  2034. # Microsoft cabinets 
  2035. # by David Necas (Yeti) <yeti@physics.muni.cz>
  2036. #0    string    MSCF\0\0\0\0    Microsoft cabinet file data,
  2037. #>25    byte    x        v%d
  2038. #>24    byte    x        \b.%d
  2039. # MPi: All CABs have version 1.3, so this is pointless.
  2040. # Better magic in debian-additions.
  2041.  
  2042. # GTKtalog catalogs 
  2043. # by David Necas (Yeti) <yeti@physics.muni.cz>
  2044. 4    string    gtktalog\     GTKtalog catalog data,
  2045. >13    string    3        version 3
  2046. >>14    beshort    0x677a        (gzipped)
  2047. >>14    beshort    !0x677a        (not gzipped)
  2048. >13    string    >3        version %s
  2049.  
  2050. ############################################################################
  2051. # Parity archive reconstruction file, the 'par' file format now used on Usenet.
  2052. 0       string          PAR\0    PARity archive data
  2053. >48    leshort        =0    - Index file
  2054. >48    leshort        >0    - file number %d
  2055.  
  2056. # Felix von Leitner <felix-file@fefe.de>
  2057. 0    string    d8:announce    BitTorrent file
  2058. !:mime    application/x-bittorrent
  2059.  
  2060. # Atari MSA archive - Teemu Hukkanen <tjhukkan@iki.fi>
  2061. 0       beshort 0x0e0f          Atari MSA archive data
  2062. >2      beshort x           \b, %d sectors per track
  2063. >4      beshort 0           \b, 1 sided
  2064. >4      beshort 1           \b, 2 sided
  2065. >6      beshort x           \b, starting track: %d
  2066. >8      beshort x           \b, ending track: %d
  2067.  
  2068. # Alternate ZIP string (amc@arwen.cs.berkeley.edu)
  2069. 0    string    PK00PK\003\004    Zip archive data
  2070.  
  2071. # ACE archive (from http://www.wotsit.org/download.asp?f=ace)
  2072. # by Stefan `Sec` Zehl <sec@42.org>
  2073. 7    string        **ACE**        ACE archive data
  2074. >15    byte    >0        version %d
  2075. >16    byte    =0x00        \b, from MS-DOS
  2076. >16    byte    =0x01        \b, from OS/2
  2077. >16    byte    =0x02        \b, from Win/32
  2078. >16    byte    =0x03        \b, from Unix
  2079. >16    byte    =0x04        \b, from MacOS
  2080. >16    byte    =0x05        \b, from WinNT
  2081. >16    byte    =0x06        \b, from Primos
  2082. >16    byte    =0x07        \b, from AppleGS
  2083. >16    byte    =0x08        \b, from Atari
  2084. >16    byte    =0x09        \b, from Vax/VMS
  2085. >16    byte    =0x0A        \b, from Amiga
  2086. >16    byte    =0x0B        \b, from Next
  2087. >14    byte    x        \b, version %d to extract
  2088. >5    leshort &0x0080        \b, multiple volumes,
  2089. >>17    byte    x        \b (part %d),
  2090. >5    leshort &0x0002        \b, contains comment
  2091. >5    leshort    &0x0200        \b, sfx
  2092. >5    leshort    &0x0400        \b, small dictionary
  2093. >5    leshort    &0x0800        \b, multi-volume
  2094. >5    leshort    &0x1000        \b, contains AV-String
  2095. >>30    string    \x16*UNREGISTERED\x20VERSION*    (unregistered)
  2096. >5    leshort &0x2000        \b, with recovery record
  2097. >5    leshort &0x4000        \b, locked
  2098. >5    leshort &0x8000        \b, solid
  2099. # Date in MS-DOS format (whatever that is)
  2100. #>18    lelong    x        Created on
  2101.  
  2102. # sfArk : compression program for Soundfonts (sf2) by Dirk Jagdmann
  2103. # <doj@cubic.org>
  2104. 0x1A    string    sfArk        sfArk compressed Soundfont
  2105. >0x15    string    2
  2106. >>0x1    string    >\0        Version %s
  2107. >>0x2A    string    >\0        : %s
  2108.  
  2109. # DR-DOS 7.03 Packed File *.??_
  2110. 0    string    Packed\ File\     Personal NetWare Packed File
  2111. >12    string    x            \b, was "%.12s"
  2112.  
  2113. # EET archive
  2114. # From: Tilman Sauerbeck <tilman@code-monkey.de>
  2115. 0    belong    0x1ee7ff00    EET archive
  2116. !:mime    application/x-eet
  2117.  
  2118. # rzip archives
  2119. 0    string    RZIP        rzip compressed data
  2120. >4    byte    x        - version %d
  2121. >5    byte    x        \b.%d
  2122. >6    belong    x        (%d bytes)
  2123.  
  2124. # From: "Robert Dale" <robdale@gmail.com>
  2125. 0    belong    123        dar archive,
  2126. >4    belong    x        label "%.8x
  2127. >>8    belong    x        %.8x
  2128. >>>12    beshort    x        %.4x"
  2129. >14    byte    0x54        end slice
  2130. >14    beshort    0x4e4e        multi-part
  2131. >14    beshort    0x4e53        multi-part, with -S
  2132.  
  2133. # Symbian installation files
  2134. #  http://www.thouky.co.uk/software/psifs/sis.html
  2135. #  http://developer.symbian.com/main/downloads/papers/SymbianOSv91/softwareinstallsis.pdf
  2136. 8    lelong    0x10000419    Symbian installation file
  2137. !:mime    application/vnd.symbian.install
  2138. >4    lelong    0x1000006D    (EPOC release 3/4/5)
  2139. >4    lelong    0x10003A12    (EPOC release 6)
  2140. 0    lelong    0x10201A7A    Symbian installation file (Symbian OS 9.x)
  2141. !:mime    x-epoc/x-sisx-app
  2142.  
  2143. # From "Nelson A. de Oliveira" <naoliv@gmail.com>
  2144. 0    string    MPQ\032        MoPaQ (MPQ) archive
  2145.  
  2146. # From: Dirk Jagdmann <doj@cubic.org>
  2147. # xar archive format: http://code.google.com/p/xar/
  2148. 0    string    xar!        xar archive
  2149. >6    beshort    x        - version %ld
  2150.  
  2151. # From: "Nelson A. de Oliveira" <naoliv@gmail.com>
  2152. # .kgb
  2153. 0    string KGB_arch        KGB Archiver file
  2154. >10    string x        with compression level %.1s
  2155.  
  2156. # xar (eXtensible ARchiver) archive
  2157. # From: "David Remahl" <dremahl@apple.com>
  2158. 0    string    xar!        xar archive
  2159. #>4    beshort    x        header size %d
  2160. >6    beshort    x        version %d,
  2161. #>8    quad    x        compressed TOC: %d,
  2162. #>16    quad    x        uncompressed TOC: %d,
  2163. >24    belong    0        no checksum
  2164. >24    belong    1        SHA-1 checksum
  2165. >24    belong    2        MD5 checksum
  2166.  
  2167. # Type: Parity Archive
  2168. # From: Daniel van Eeden <daniel_e@dds.nl>
  2169. 0    string     PAR2        Parity Archive Volume Set
  2170.  
  2171. #------------------------------------------------------------------------------
  2172. # asterix:  file(1) magic for Aster*x; SunOS 5.5.1 gave the 4-character
  2173. # strings as "long" - we assume they're just strings:
  2174. # From: guy@netapp.com (Guy Harris)
  2175. #
  2176. 0    string        *STA        Aster*x
  2177. >7    string        WORD            Words Document
  2178. >7    string        GRAP            Graphic
  2179. >7    string        SPRE            Spreadsheet
  2180. >7    string        MACR            Macro
  2181. 0    string        2278        Aster*x Version 2
  2182. >29    byte        0x36            Words Document
  2183. >29    byte        0x35            Graphic
  2184. >29    byte        0x32            Spreadsheet
  2185. >29    byte        0x38            Macro
  2186.  
  2187.  
  2188. #------------------------------------------------------------------------------
  2189. # att3b:  file(1) magic for AT&T 3B machines
  2190. #
  2191. # The `versions' should be un-commented if they work for you.
  2192. # (Was the problem just one of endianness?)
  2193. #
  2194. # 3B20
  2195. #
  2196. # The 3B20 conflicts with SCCS.
  2197. #0    beshort        0550        3b20 COFF executable
  2198. #>12    belong        >0        not stripped
  2199. #>22    beshort        >0        - version %ld
  2200. #0    beshort        0551        3b20 COFF executable (TV)
  2201. #>12    belong        >0        not stripped
  2202. #>22    beshort        >0        - version %ld
  2203. #
  2204. # WE32K
  2205. #
  2206. 0    beshort        0560        WE32000 COFF
  2207. >18    beshort        ^00000020    object
  2208. >18    beshort        &00000020    executable
  2209. >12    belong        >0        not stripped
  2210. >18    beshort        ^00010000    N/A on 3b2/300 w/paging
  2211. >18    beshort        &00020000    32100 required
  2212. >18    beshort        &00040000    and MAU hardware required
  2213. >20    beshort        0407        (impure)
  2214. >20    beshort        0410        (pure)
  2215. >20    beshort        0413        (demand paged)
  2216. >20    beshort        0443        (target shared library)
  2217. >22    beshort        >0        - version %ld
  2218. 0    beshort        0561        WE32000 COFF executable (TV)
  2219. >12    belong        >0        not stripped
  2220. #>18    beshort        &00020000    - 32100 required
  2221. #>18    beshort        &00040000    and MAU hardware required
  2222. #>22    beshort        >0        - version %ld
  2223. #
  2224. # core file for 3b2 
  2225. 0    string        \000\004\036\212\200    3b2 core file
  2226. >364    string        >\0        of '%s'
  2227. #------------------------------------------------------------------------------
  2228. # audio:  file(1) magic for sound formats (see also "iff")
  2229. #
  2230. # Jan Nicolai Langfeldt (janl@ifi.uio.no), Dan Quinlan (quinlan@yggdrasil.com),
  2231. # and others
  2232. #
  2233.  
  2234. # Sun/NeXT audio data
  2235. 0    string        .snd        Sun/NeXT audio data:
  2236. >12    belong        1        8-bit ISDN mu-law,
  2237. !:mime    audio/basic
  2238. >12    belong        2        8-bit linear PCM [REF-PCM],
  2239. !:mime    audio/basic
  2240. >12    belong        3        16-bit linear PCM,
  2241. !:mime    audio/basic
  2242. >12    belong        4        24-bit linear PCM,
  2243. !:mime    audio/basic
  2244. >12    belong        5        32-bit linear PCM,
  2245. !:mime    audio/basic
  2246. >12    belong        6        32-bit IEEE floating point,
  2247. !:mime    audio/basic
  2248. >12    belong        7        64-bit IEEE floating point,
  2249. !:mime    audio/basic
  2250. >12    belong        8        Fragmented sample data,
  2251. >12    belong        10        DSP program,
  2252. >12    belong        11        8-bit fixed point,
  2253. >12    belong        12        16-bit fixed point,
  2254. >12    belong        13        24-bit fixed point,
  2255. >12    belong        14        32-bit fixed point,
  2256. >12    belong        18        16-bit linear with emphasis,
  2257. >12    belong        19        16-bit linear compressed,
  2258. >12    belong        20        16-bit linear with emphasis and compression,
  2259. >12    belong        21        Music kit DSP commands,
  2260. >12    belong        23        8-bit ISDN mu-law compressed (CCITT G.721 ADPCM voice enc.),
  2261. !:mime  audio/x-adpcm
  2262. >12    belong        24        compressed (8-bit CCITT G.722 ADPCM)
  2263. >12    belong        25        compressed (3-bit CCITT G.723.3 ADPCM),
  2264. >12    belong        26        compressed (5-bit CCITT G.723.5 ADPCM),
  2265. >12    belong        27        8-bit A-law (CCITT G.711),
  2266. >20    belong        1        mono,
  2267. >20    belong        2        stereo,
  2268. >20    belong        4        quad,
  2269. >16    belong        >0        %d Hz
  2270.  
  2271. # DEC systems (e.g. DECstation 5000) use a variant of the Sun/NeXT format
  2272. # that uses little-endian encoding and has a different magic number
  2273. 0    lelong        0x0064732E    DEC audio data:
  2274. >12    lelong        1        8-bit ISDN mu-law,
  2275. !:mime    audio/x-dec-basic
  2276. >12    lelong        2        8-bit linear PCM [REF-PCM],
  2277. !:mime    audio/x-dec-basic
  2278. >12    lelong        3        16-bit linear PCM,
  2279. !:mime    audio/x-dec-basic
  2280. >12    lelong        4        24-bit linear PCM,
  2281. !:mime    audio/x-dec-basic
  2282. >12    lelong        5        32-bit linear PCM,
  2283. !:mime    audio/x-dec-basic
  2284. >12    lelong        6        32-bit IEEE floating point,
  2285. !:mime    audio/x-dec-basic
  2286. >12    lelong        7        64-bit IEEE floating point,
  2287. !:mime    audio/x-dec-basic
  2288. >12    belong        8        Fragmented sample data,
  2289. >12    belong        10        DSP program,
  2290. >12    belong        11        8-bit fixed point,
  2291. >12    belong        12        16-bit fixed point,
  2292. >12    belong        13        24-bit fixed point,
  2293. >12    belong        14        32-bit fixed point,
  2294. >12    belong        18        16-bit linear with emphasis,
  2295. >12    belong        19        16-bit linear compressed,
  2296. >12    belong        20        16-bit linear with emphasis and compression,
  2297. >12    belong        21        Music kit DSP commands,
  2298. >12    lelong        23        8-bit ISDN mu-law compressed (CCITT G.721 ADPCM voice enc.),
  2299. !:mime    audio/x-dec-basic
  2300. >12    belong        24        compressed (8-bit CCITT G.722 ADPCM)
  2301. >12    belong        25        compressed (3-bit CCITT G.723.3 ADPCM),
  2302. >12    belong        26        compressed (5-bit CCITT G.723.5 ADPCM),
  2303. >12    belong        27        8-bit A-law (CCITT G.711),
  2304. >20    lelong        1        mono,
  2305. >20    lelong        2        stereo,
  2306. >20    lelong        4        quad,
  2307. >16    lelong        >0        %d Hz
  2308.  
  2309. # Creative Labs AUDIO stuff
  2310. 0    string    MThd            Standard MIDI data
  2311. !:mime    audio/midi
  2312. >8     beshort    x            (format %d)
  2313. >10    beshort    x            using %d track
  2314. >10    beshort        >1        \bs
  2315. >12    beshort&0x7fff    x        at 1/%d
  2316. >12    beshort&0x8000    >0        SMPTE
  2317.  
  2318. 0    string    CTMF            Creative Music (CMF) data
  2319. !:mime    audio/x-unknown
  2320. 0    string    SBI            SoundBlaster instrument data
  2321. !:mime    audio/x-unknown
  2322. 0    string    Creative\ Voice\ File    Creative Labs voice data
  2323. !:mime    audio/x-unknown
  2324. # is this next line right?  it came this way...
  2325. >19    byte    0x1A
  2326. >23    byte    >0            - version %d
  2327. >22    byte    >0            \b.%d
  2328.  
  2329. # first entry is also the string "NTRK"
  2330. 0    belong        0x4e54524b    MultiTrack sound data
  2331. >4    belong        x        - version %ld
  2332.  
  2333. # Extended MOD format (*.emd) (Greg Roelofs, newt@uchicago.edu); NOT TESTED
  2334. # [based on posting 940824 by "Dirk/Elastik", husberg@lehtori.cc.tut.fi]
  2335. 0    string        EMOD        Extended MOD sound data,
  2336. >4    byte&0xf0    x        version %d
  2337. >4    byte&0x0f    x        \b.%d,
  2338. >45    byte        x        %d instruments
  2339. >83    byte        0        (module)
  2340. >83    byte        1        (song)
  2341.  
  2342. # Real Audio (Magic .ra\0375)
  2343. 0    belong        0x2e7261fd    RealAudio sound file
  2344. !:mime    audio/x-pn-realaudio
  2345. 0    string        .RMF\0\0\0    RealMedia file
  2346. !:mime    application/vnd.rn-realmedia
  2347. #video/x-pn-realvideo
  2348. #video/vnd.rn-realvideo
  2349. #application/vnd.rn-realmedia
  2350. #    sigh, there are many mimes for that but the above are the most common.
  2351.  
  2352. # MTM/669/FAR/S3M/ULT/XM format checking [Aaron Eppert, aeppert@dialin.ind.net]
  2353. # Oct 31, 1995
  2354. # fixed by <doj@cubic.org> 2003-06-24
  2355. # Too short...
  2356. #0    string        MTM        MultiTracker Module sound file
  2357. #0    string        if        Composer 669 Module sound data
  2358. #0    string        JN        Composer 669 Module sound data (extended format)
  2359. 0    string        MAS_U        ULT(imate) Module sound data
  2360.  
  2361. #0    string        FAR        Module sound data
  2362. #>4    string        >\15        Title: "%s"
  2363.  
  2364. 0x2c    string        SCRM        ScreamTracker III Module sound data
  2365. >0    string        >\0        Title: "%s"
  2366.  
  2367. # Gravis UltraSound patches
  2368. # From <ache@nagual.ru>
  2369.  
  2370. 0    string        GF1PATCH110\0ID#000002\0    GUS patch
  2371. 0    string        GF1PATCH100\0ID#000002\0    Old GUS    patch
  2372.  
  2373. # mime types according to http://www.geocities.com/nevilo/mod.htm:
  2374. #    audio/it    .it
  2375. #    audio/x-zipped-it    .itz
  2376. #    audio/xm    fasttracker modules
  2377. #    audio/x-s3m    screamtracker modules
  2378. #    audio/s3m    screamtracker modules
  2379. #    audio/x-zipped-mod    mdz
  2380. #    audio/mod    mod
  2381. #    audio/x-mod    All modules (mod, s3m, 669, mtm, med, xm, it, mdz, stm, itz, xmz, s3z)
  2382.  
  2383. #
  2384. # Taken from loader code from mikmod version 2.14
  2385. # by Steve McIntyre (stevem@chiark.greenend.org.uk)
  2386. # <doj@cubic.org> added title printing on 2003-06-24
  2387. 0    string    MAS_UTrack_V00
  2388. >14    string    >/0        ultratracker V1.%.1s module sound data
  2389. !:mime    audio/x-mod
  2390. #audio/x-tracker-module
  2391.  
  2392. 0    string    UN05        MikMod UNI format module sound data
  2393.  
  2394. 0    string    Extended\ Module: Fasttracker II module sound data
  2395. !:mime    audio/x-mod
  2396. #audio/x-tracker-module
  2397. >17    string    >\0        Title: "%s"
  2398.  
  2399. 21    string/c    =!SCREAM!    Screamtracker 2 module sound data
  2400. !:mime    audio/x-mod
  2401. #audio/x-screamtracker-module
  2402. 21    string    BMOD2STM    Screamtracker 2 module sound data
  2403. !:mime    audio/x-mod
  2404. #audio/x-screamtracker-module
  2405. 1080    string    M.K.        4-channel Protracker module sound data
  2406. !:mime    audio/x-mod
  2407. #audio/x-protracker-module
  2408. >0    string    >\0        Title: "%s"
  2409. 1080    string    M!K!        4-channel Protracker module sound data
  2410. !:mime    audio/x-mod
  2411. #audio/x-protracker-module
  2412. >0    string    >\0        Title: "%s"
  2413. 1080    string    FLT4        4-channel Startracker module sound data
  2414. !:mime    audio/x-mod
  2415. #audio/x-startracker-module
  2416. >0    string    >\0        Title: "%s"
  2417. 1080    string    FLT8        8-channel Startracker module sound data
  2418. !:mime    audio/x-mod
  2419. #audio/x-startracker-module
  2420. >0    string    >\0        Title: "%s"
  2421. 1080    string    4CHN        4-channel Fasttracker module sound data
  2422. !:mime    audio/x-mod
  2423. #audio/x-fasttracker-module
  2424. >0    string    >\0        Title: "%s"
  2425. 1080    string    6CHN        6-channel Fasttracker module sound data
  2426. !:mime    audio/x-mod
  2427. #audio/x-fasttracker-module
  2428. >0    string    >\0        Title: "%s"
  2429. 1080    string    8CHN        8-channel Fasttracker module sound data
  2430. !:mime    audio/x-mod
  2431. #audio/x-fasttracker-module
  2432. >0    string    >\0        Title: "%s"
  2433. 1080    string    CD81        8-channel Octalyser module sound data
  2434. !:mime    audio/x-mod
  2435. #audio/x-octalysertracker-module
  2436. >0    string    >\0        Title: "%s"
  2437. 1080    string    OKTA        8-channel Octalyzer module sound data
  2438. !:mime    audio/x-mod
  2439. #audio/x-octalysertracker-module
  2440. >0    string    >\0        Title: "%s"
  2441. # Not good enough.
  2442. #1082    string    CH
  2443. #>1080    string    >/0        %.2s-channel Fasttracker "oktalyzer" module sound data
  2444. 1080    string    16CN        16-channel Taketracker module sound data
  2445. !:mime    audio/x-mod
  2446. #audio/x-taketracker-module
  2447. >0    string    >\0        Title: "%s"
  2448. 1080    string    32CN        32-channel Taketracker module sound data
  2449. !:mime    audio/x-mod
  2450. #audio/x-taketracker-module
  2451. >0    string    >\0        Title: "%s"
  2452.  
  2453. # TOC sound files -Trevor Johnson <trevor@jpj.net>
  2454. #
  2455. 0       string          TOC             TOC sound file
  2456.  
  2457. # sidfiles <pooka@iki.fi>
  2458. # added name,author,(c) and new RSID type by <doj@cubic.org> 2003-06-24
  2459. 0    string        SIDPLAY\ INFOFILE    Sidplay info file
  2460.  
  2461. 0    string        PSID            PlaySID v2.2+ (AMIGA) sidtune
  2462. >4    beshort        >0            w/ header v%d,
  2463. >14    beshort        =1            single song,
  2464. >14    beshort        >1            %d songs,
  2465. >16    beshort        >0            default song: %d
  2466. >0x16    string        >\0            name: "%s"
  2467. >0x36    string        >\0            author: "%s"
  2468. >0x56    string        >\0            copyright: "%s"
  2469.  
  2470. 0    string        RSID            RSID sidtune PlaySID compatible
  2471. >4    beshort        >0            w/ header v%d,
  2472. >14    beshort        =1            single song,
  2473. >14    beshort        >1            %d songs,
  2474. >16    beshort        >0            default song: %d
  2475. >0x16    string        >\0            name: "%s"
  2476. >0x36    string        >\0            author: "%s"
  2477. >0x56    string        >\0            copyright: "%s"
  2478.  
  2479. # IRCAM <mpruett@sgi.com>
  2480. # VAX and MIPS files are little-endian; Sun and NeXT are big-endian
  2481. 0    belong        0x64a30100        IRCAM file (VAX)
  2482. 0    belong        0x64a30200        IRCAM file (Sun)
  2483. 0    belong        0x64a30300        IRCAM file (MIPS little-endian)
  2484. 0    belong        0x64a30400        IRCAM file (NeXT)
  2485.  
  2486. # NIST SPHERE <mpruett@sgi.com>
  2487. 0    string        NIST_1A\n\ \ \ 1024\n    NIST SPHERE file
  2488.  
  2489. # Sample Vision <mpruett@sgi.com>
  2490. 0    string        SOUND\ SAMPLE\ DATA\     Sample Vision file
  2491.  
  2492. # Audio Visual Research <tonigonenstein@users.sourceforge.net>
  2493. 0    string        2BIT            Audio Visual Research file,
  2494. >12    beshort        =0            mono,
  2495. >12    beshort        =-1            stereo,
  2496. >14    beshort        x            %d bits
  2497. >16    beshort        =0            unsigned,
  2498. >16    beshort        =-1            signed,
  2499. >22    belong&0x00ffffff    x        %d Hz,
  2500. >18    beshort        =0            no loop,
  2501. >18    beshort        =-1            loop,
  2502. >21    ubyte        <128            note %d,
  2503. >22    byte        =0            replay 5.485 KHz
  2504. >22    byte        =1            replay 8.084 KHz
  2505. >22    byte        =2            replay 10.971 Khz
  2506. >22    byte        =3            replay 16.168 Khz
  2507. >22    byte        =4            replay 21.942 KHz
  2508. >22    byte        =5            replay 32.336 KHz
  2509. >22    byte        =6            replay 43.885 KHz
  2510. >22    byte        =7            replay 47.261 KHz
  2511.  
  2512. # SGI SoundTrack <mpruett@sgi.com>
  2513. 0    string        _SGI_SoundTrack        SGI SoundTrack project file
  2514. # ID3 version 2 tags <waschk@informatik.uni-rostock.de>
  2515. 0    string        ID3    Audio file with ID3 version 2.
  2516. # ??? Normally such a file is an MP3 file, but this will give false positives
  2517. !:mime    audio/mpeg
  2518. >3    ubyte    <0xff    \b%d
  2519. #>4    ubyte    <0xff    \b%d tag
  2520. >2584    string    fLaC        \b, FLAC encoding
  2521. >>2588    byte&0x7f        >0        \b, unknown version
  2522. >>2588    byte&0x7f        0        \b
  2523. # some common bits/sample values
  2524. >>>2600    beshort&0x1f0        0x030        \b, 4 bit
  2525. >>>2600    beshort&0x1f0        0x050        \b, 6 bit
  2526. >>>2600    beshort&0x1f0        0x070        \b, 8 bit
  2527. >>>2600    beshort&0x1f0        0x0b0        \b, 12 bit
  2528. >>>2600    beshort&0x1f0        0x0f0        \b, 16 bit
  2529. >>>2600    beshort&0x1f0        0x170        \b, 24 bit
  2530. >>>2600    byte&0xe        0x0        \b, mono
  2531. >>>2600    byte&0xe        0x2        \b, stereo
  2532. >>>2600    byte&0xe        0x4        \b, 3 channels
  2533. >>>2600    byte&0xe        0x6        \b, 4 channels
  2534. >>>2600    byte&0xe        0x8        \b, 5 channels
  2535. >>>2600    byte&0xe        0xa        \b, 6 channels
  2536. >>>2600    byte&0xe        0xc        \b, 7 channels
  2537. >>>2600    byte&0xe        0xe        \b, 8 channels
  2538. # some common sample rates
  2539. >>>2597    belong&0xfffff0        0x0ac440    \b, 44.1 kHz
  2540. >>>2597    belong&0xfffff0        0x0bb800    \b, 48 kHz
  2541. >>>2597    belong&0xfffff0        0x07d000    \b, 32 kHz
  2542. >>>2597    belong&0xfffff0        0x056220    \b, 22.05 kHz
  2543. >>>2597    belong&0xfffff0        0x05dc00    \b, 24 kHz
  2544. >>>2597    belong&0xfffff0        0x03e800    \b, 16 kHz
  2545. >>>2597    belong&0xfffff0        0x02b110    \b, 11.025 kHz
  2546. >>>2597    belong&0xfffff0        0x02ee00    \b, 12 kHz
  2547. >>>2597    belong&0xfffff0        0x01f400    \b, 8 kHz
  2548. >>>2597    belong&0xfffff0        0x177000    \b, 96 kHz
  2549. >>>2597    belong&0xfffff0        0x0fa000    \b, 64 kHz
  2550. >>>2601    byte&0xf        >0        \b, >4G samples
  2551. >2584    string    !fLaC        \b, MP3 encoding
  2552.  
  2553. # NSF (NES sound file) magic
  2554. 0    string        NESM\x1a    NES Sound File
  2555. >14    string        >\0        ("%s" by
  2556. >46    string        >\0        %s, copyright
  2557. >78    string        >\0        %s),
  2558. >5    byte        x        version %d,
  2559. >6    byte        x        %d tracks,
  2560. >122    byte&0x2    =1        dual PAL/NTSC
  2561. >122    byte&0x1    =1        PAL
  2562. >122    byte&0x1    =0        NTSC
  2563.  
  2564. # Type: SNES SPC700 sound files
  2565. # From: Josh Triplett <josh@freedesktop.org>
  2566. 0    string    SNES-SPC700\ Sound\ File\ Data\ v    SNES SPC700 sound file
  2567. >&0    string    0.30                    \b, version %s
  2568. >>0x23    byte    0x1B                    \b, without ID666 tag
  2569. >>0x23    byte    0x1A                    \b, with ID666 tag
  2570. >>>0x2E    string    >\0                    \b, song "%.32s"
  2571. >>>0x4E    string    >\0                    \b, game "%.32s"
  2572.  
  2573. # Impulse tracker module (audio/x-it)
  2574. 0    string        IMPM        Impulse Tracker module sound data -
  2575. !:mime    audio/x-mod
  2576. >4    string        >\0        "%s"
  2577. >40    leshort        !0        compatible w/ITv%x
  2578. >42    leshort        !0        created w/ITv%x
  2579.  
  2580. # Imago Orpheus module (audio/x-imf)
  2581. 60    string        IM10        Imago Orpheus module sound data -
  2582. >0    string        >\0        "%s"
  2583.  
  2584. # From <collver1@attbi.com>
  2585. # These are the /etc/magic entries to decode modules, instruments, and
  2586. # samples in Impulse Tracker's native format.
  2587.  
  2588. 0    string        IMPS        Impulse Tracker Sample
  2589. >18    byte        &2        16 bit
  2590. >18    byte        ^2        8 bit
  2591. >18    byte        &4        stereo
  2592. >18    byte        ^4        mono
  2593. 0    string        IMPI        Impulse Tracker Instrument
  2594. >28    leshort        !0        ITv%x
  2595. >30    byte        !0        %d samples
  2596.  
  2597. # Yamaha TX Wave:  file(1) magic for Yamaha TX Wave audio files
  2598. # From <collver1@attbi.com>
  2599. 0    string        LM8953        Yamaha TX Wave
  2600. >22    byte        0x49        looped
  2601. >22    byte        0xC9        non-looped
  2602. >23    byte        1        33kHz
  2603. >23    byte        2        50kHz
  2604. >23    byte        3        16kHz
  2605.  
  2606. # scream tracker:  file(1) magic for Scream Tracker sample files
  2607. #
  2608. # From <collver1@attbi.com>
  2609. 76    string        SCRS        Scream Tracker Sample
  2610. >0    byte        1        sample
  2611. >0    byte        2        adlib melody
  2612. >0    byte        >2        adlib drum
  2613. >31    byte        &2        stereo
  2614. >31    byte        ^2        mono
  2615. >31    byte        &4        16bit little endian
  2616. >31    byte        ^4        8bit
  2617. >30    byte        0        unpacked
  2618. >30    byte        1        packed
  2619.  
  2620. # audio
  2621. # From: Cory Dikkers <cdikkers@swbell.net>
  2622. 0    string        MMD0        MED music file, version 0
  2623. 0    string        MMD1        OctaMED Pro music file, version 1
  2624. 0    string        MMD3        OctaMED Soundstudio music file, version 3
  2625. 0    string        OctaMEDCmpr    OctaMED Soundstudio compressed file
  2626. 0    string        MED        MED_Song
  2627. 0    string        SymM        Symphonie SymMOD music file
  2628. #
  2629. 0    string        THX        AHX version
  2630. >3    byte        =0        1 module data
  2631. >3    byte        =1        2 module data
  2632. #
  2633. 0    string        OKTASONG    Oktalyzer module data
  2634. #
  2635. 0    string        DIGI\ Booster\ module\0    %s
  2636. >20    byte        >0        %c
  2637. >>21    byte        >0        \b%c
  2638. >>>22    byte        >0        \b%c
  2639. >>>>23    byte        >0        \b%c
  2640. >610    string        >\0        \b, "%s"
  2641. #
  2642. 0    string        DBM0           DIGI Booster Pro Module
  2643. >4    byte        >0        V%X.
  2644. >>5    byte        x        \b%02X
  2645. >16    string        >\0        \b, "%s"
  2646. #
  2647. 0    string        FTMN        FaceTheMusic module
  2648. >16    string        >\0d        \b, "%s"
  2649.  
  2650. # From: <doj@cubic.org> 2003-06-24
  2651. 0    string        AMShdr\32    Velvet Studio AMS Module v2.2
  2652. 0    string        Extreme        Extreme Tracker AMS Module v1.3
  2653. 0    string        DDMF        Xtracker DMF Module
  2654. >4    byte        x        v%i
  2655. >0xD    string        >\0        Title: "%s"
  2656. >0x2B    string        >\0        Composer: "%s"
  2657. 0    string        DSM\32        Dynamic Studio Module DSM
  2658. 0    string        SONG        DigiTrekker DTM Module
  2659. 0    string        DMDL        DigiTrakker MDL Module
  2660. 0    string        PSM\32        Protracker Studio PSM Module
  2661. 44    string        PTMF        Poly Tracker PTM Module
  2662. >0    string        >\32        Title: "%s"
  2663. 0    string        MT20        MadTracker 2.0 Module MT2
  2664. 0    string        RAD\40by\40REALiTY!! RAD Adlib Tracker Module RAD
  2665. 0    string        RTMM        RTM Module
  2666. 0x426    string        MaDoKaN96    XMS Adlib Module
  2667. >0    string        >\0        Composer: "%s"
  2668. 0    string        AMF        AMF Module
  2669. >4    string        >\0        Title: "%s"
  2670. 0    string        MODINFO1    Open Cubic Player Module Inforation MDZ
  2671. 0    string        Extended\40Instrument: Fast Tracker II Instrument
  2672.  
  2673. # From: Takeshi Hamasaki <hma@syd.odn.ne.jp>
  2674. # NOA Nancy Codec file
  2675. 0    string        \210NOA\015\012\032    NOA Nancy Codec Movie file
  2676. # Yamaha SMAF format
  2677. 0    string        MMMD        Yamaha SMAF file
  2678. # Sharp Jisaku Melody format for PDC
  2679. 0    string        \001Sharp\040JisakuMelody    SHARP Cell-Phone ringing Melody
  2680. >20    string        Ver01.00    Ver. 1.00
  2681. >>32    byte        x        , %d tracks
  2682.  
  2683. # Free lossless audio codec <http://flac.sourceforge.net>
  2684. # From: Przemyslaw Augustyniak <silvathraec@rpg.pl>
  2685. 0    string            fLaC        FLAC audio bitstream data
  2686. !:mime    audio/x-flac
  2687. >4    byte&0x7f        >0        \b, unknown version
  2688. >4    byte&0x7f        0        \b
  2689. # some common bits/sample values
  2690. >>20    beshort&0x1f0        0x030        \b, 4 bit
  2691. >>20    beshort&0x1f0        0x050        \b, 6 bit
  2692. >>20    beshort&0x1f0        0x070        \b, 8 bit
  2693. >>20    beshort&0x1f0        0x0b0        \b, 12 bit
  2694. >>20    beshort&0x1f0        0x0f0        \b, 16 bit
  2695. >>20    beshort&0x1f0        0x170        \b, 24 bit
  2696. >>20    byte&0xe        0x0        \b, mono
  2697. >>20    byte&0xe        0x2        \b, stereo
  2698. >>20    byte&0xe        0x4        \b, 3 channels
  2699. >>20    byte&0xe        0x6        \b, 4 channels
  2700. >>20    byte&0xe        0x8        \b, 5 channels
  2701. >>20    byte&0xe        0xa        \b, 6 channels
  2702. >>20    byte&0xe        0xc        \b, 7 channels
  2703. >>20    byte&0xe        0xe        \b, 8 channels
  2704. # some common sample rates
  2705. >>17    belong&0xfffff0        0x0ac440    \b, 44.1 kHz
  2706. >>17    belong&0xfffff0        0x0bb800    \b, 48 kHz
  2707. >>17    belong&0xfffff0        0x07d000    \b, 32 kHz
  2708. >>17    belong&0xfffff0        0x056220    \b, 22.05 kHz
  2709. >>17    belong&0xfffff0        0x05dc00    \b, 24 kHz
  2710. >>17    belong&0xfffff0        0x03e800    \b, 16 kHz
  2711. >>17    belong&0xfffff0        0x02b110    \b, 11.025 kHz
  2712. >>17    belong&0xfffff0        0x02ee00    \b, 12 kHz
  2713. >>17    belong&0xfffff0        0x01f400    \b, 8 kHz
  2714. >>17    belong&0xfffff0        0x177000    \b, 96 kHz
  2715. >>17    belong&0xfffff0        0x0fa000    \b, 64 kHz
  2716. >>21    byte&0xf        >0        \b, >4G samples
  2717. >>21    byte&0xf        0        \b
  2718. >>>22    belong            >0        \b, %u samples
  2719. >>>22    belong            0        \b, length unknown
  2720.  
  2721. # (ISDN) VBOX voice message file (Wolfram Kleff)
  2722. 0       string          VBOX            VBOX voice message data
  2723.  
  2724. # ReBorn Song Files (.rbs)
  2725. # David J. Singer <doc@deadvirgins.org.uk>
  2726. 8       string          RB40             RBS Song file
  2727. >29     string          ReBorn           created by ReBorn
  2728. >37     string          Propellerhead    created by ReBirth
  2729.  
  2730. # Synthesizer Generator and Kimwitu share their file format
  2731. 0    string        A#S#C#S#S#L#V#3        Synthesizer Generator or Kimwitu data
  2732. # Kimwitu++ uses a slightly different magic
  2733. 0    string        A#S#C#S#S#L#HUB        Kimwitu++ data
  2734.  
  2735. # From "Simon Hosie
  2736. 0       string  TFMX-SONG       TFMX module sound data
  2737.  
  2738. # Monkey's Audio compressed audio format (.ape)
  2739. # From danny.milo@gmx.net (Danny Milosavljevic)
  2740. # New version from Abel Cheung <abel (@) oaka.org>
  2741. 0        string        MAC\040        Monkey's Audio compressed format
  2742. >4        uleshort    >0x0F8B        version %d
  2743. >>(0x08.l)    uleshort    =1000        with fast compression
  2744. >>(0x08.l)    uleshort    =2000        with normal compression
  2745. >>(0x08.l)    uleshort    =3000        with high compression
  2746. >>(0x08.l)    uleshort    =4000        with extra high compression
  2747. >>(0x08.l)    uleshort    =5000        with insane compression
  2748. >>(0x08.l+18)    uleshort    =1        \b, mono
  2749. >>(0x08.l+18)    uleshort    =2        \b, stereo
  2750. >>(0x08.l+20)    ulelong        x        \b, sample rate %d
  2751. >4        uleshort    <0x0F8C        version %d
  2752. >>6        uleshort    =1000        with fast compression
  2753. >>6        uleshort    =2000        with normal compression
  2754. >>6        uleshort    =3000        with high compression
  2755. >>6        uleshort    =4000        with extra high compression
  2756. >>6        uleshort    =5000        with insane compression
  2757. >>10        uleshort    =1        \b, mono
  2758. >>10        uleshort    =2        \b, stereo
  2759. >>12        ulelong        x        \b, sample rate %d
  2760.  
  2761. # adlib sound files
  2762. # From Gürkan Sengün <gurkan@linuks.mine.nu>, http://www.linuks.mine.nu
  2763. 0        string        RAWADATA    RdosPlay RAW
  2764.  
  2765. 1068    string        RoR        AMUSIC Adlib Tracker
  2766.  
  2767. 0    string        JCH        EdLib
  2768.  
  2769. 0    string        mpu401tr    MPU-401 Trakker
  2770.  
  2771. 0    string        SAdT        Surprise! Adlib Tracker
  2772. >4    byte        x        Version %d
  2773.  
  2774. 0    string        XAD!        eXotic ADlib
  2775.  
  2776. 0    string        ofTAZ!        eXtra Simple Music
  2777.  
  2778. # Spectrum 128 tunes (.ay files).
  2779. # From: Emanuel Haupt <ehaupt@critical.ch>
  2780. 0    string        ZXAYEMUL    Spectrum 128 tune
  2781.  
  2782. 0    string        \0BONK        BONK,
  2783. #>5    byte        x        version %d
  2784. >14    byte        x        %d channel(s),
  2785. >15    byte        =1        lossless,
  2786. >15    byte        =0        lossy,
  2787. >16    byte        x        mid-side
  2788.  
  2789. 384    string        LockStream    LockStream Embedded file (mostly MP3 on old Nokia phones)
  2790.  
  2791. # format VQF (proprietary codec for sound)
  2792. # some infos on the header file available at :
  2793. # http://www.twinvq.org/english/technology_format.html
  2794. 0    string        TWIN97012000    VQF data
  2795. >27    short        0        \b, Mono
  2796. >27    short        1        \b, Stereo
  2797. >31    short         >0        \b, %d kbit/s
  2798. >35    short         >0        \b, %d kHz
  2799.  
  2800. # Nelson A. de Oliveira (naoliv@gmail.com)
  2801. # .eqf
  2802. 0    string    Winamp\ EQ\ library\ file    %s
  2803. # it will match only versions like v<digit>.<digit>
  2804. # Since I saw only eqf files with version v1.1 I think that it's OK
  2805. >23    string    x    \b%.4s
  2806. # .preset
  2807. 0    string    [Equalizer\ preset]    XMMS equalizer preset
  2808. # .m3u
  2809. 0    search/1    #EXTM3U     M3U playlist text
  2810. # .pls
  2811. 0    search/1    [playlist]    PLS playlist text
  2812. # licq.conf
  2813. 1    string    [licq]            LICQ configuration file
  2814.  
  2815. # Atari ST audio files by Dirk Jagdmann <doj@cubic.org>
  2816. 0    string        ICE!        SNDH Atari ST music
  2817. 0    string        SC68\ Music-file\ /\ (c)\ (BeN)jami    sc68 Atari ST music
  2818.  
  2819. # musepak support From: "Jiri Pejchal" <jiri.pejchal@gmail.com>
  2820. 0       string          MP+     Musepack audio
  2821. >3      byte            255     \b, SV pre8
  2822. >3      byte&0xF        0x6     \b, SV 6
  2823. >3      byte&0xF        0x8     \b, SV 8
  2824. >3      byte&0xF        0x7     \b, SV 7
  2825. >>3     byte&0xF0       0x0     \b.0
  2826. >>3     byte&0xF0       0x10    \b.1
  2827. >>3     byte&0xF0       240     \b.15
  2828. >>10    byte&0xF0       0x0     \b, no profile
  2829. >>10    byte&0xF0       0x10    \b, profile 'Unstable/Experimental'
  2830. >>10    byte&0xF0       0x50    \b, quality 0
  2831. >>10    byte&0xF0       0x60    \b, quality 1
  2832. >>10    byte&0xF0       0x70    \b, quality 2 (Telephone)
  2833. >>10    byte&0xF0       0x80    \b, quality 3 (Thumb)
  2834. >>10    byte&0xF0       0x90    \b, quality 4 (Radio)
  2835. >>10    byte&0xF0       0xA0    \b, quality 5 (Standard)
  2836. >>10    byte&0xF0       0xB0    \b, quality 6 (Xtreme)
  2837. >>10    byte&0xF0       0xC0    \b, quality 7 (Insane)
  2838. >>10    byte&0xF0       0xD0    \b, quality 8 (BrainDead)
  2839. >>10    byte&0xF0       0xE0    \b, quality 9
  2840. >>10    byte&0xF0       0xF0    \b, quality 10
  2841. >>27    byte            0x0     \b, Buschmann 1.7.0-9, Klemm 0.90-1.05
  2842. >>27    byte            102     \b, Beta 1.02
  2843. >>27    byte            104     \b, Beta 1.04
  2844. >>27    byte            105     \b, Alpha 1.05
  2845. >>27    byte            106     \b, Beta 1.06
  2846. >>27    byte            110     \b, Release 1.1
  2847. >>27    byte            111     \b, Alpha 1.11
  2848. >>27    byte            112     \b, Beta 1.12
  2849. >>27    byte            113     \b, Alpha 1.13
  2850. >>27    byte            114     \b, Beta 1.14
  2851. >>27    byte            115     \b, Alpha 1.15
  2852.  
  2853. # IMY
  2854. # from http://filext.com/detaillist.php?extdetail=IMY
  2855. # http://cellphones.about.com/od/cellularfaqs/f/rf_imelody.htm
  2856. # http://download.ncl.ie/doc/api/ie/ncl/media/music/IMelody.html
  2857. # http://www.wx800.com/msg/download/irda/iMelody.pdf
  2858. 0    string    BEGIN:IMELODY    iMelody Ringtone Format
  2859.  
  2860. # From: "Mateus Caruccio" <mateus@caruccio.com>
  2861. # guitar pro v3,4,5 from http://filext.com/file-extension/gp3
  2862. 0    string    \030FICHIER\ GUITAR\ PRO\ v3.    Guitar Pro Ver. 3 Tablature
  2863.  
  2864. # From: "Leslie P. Polzer" <leslie.polzer@gmx.net>
  2865. 60    string    SONG        SoundFX Module sound file
  2866.  
  2867. # Type: Adaptive Multi-Rate Codec
  2868. # URL:  http://filext.com/detaillist.php?extdetail=AMR
  2869. # From: Russell Coker <russell@coker.com.au>
  2870. 0    string    #!AMR        Adaptive Multi-Rate Codec (GSM telephony)
  2871.  
  2872. # Type: SuperCollider 3 Synth Definition File Format
  2873. # From: Mario Lang <mlang@debian.org>
  2874. 0    string    SCgf    SuperCollider3 Synth Definition file,
  2875. >4    belong    x    version %d
  2876. #----------------------------------------------------------------
  2877. # basis: file(1) magic for BBx/Pro5-files
  2878. #      Oliver Dammer <dammer@olida.de>     2005/11/07
  2879. # http://www.basis.com business-basic-files.
  2880. #
  2881. 0    string        \074\074bbx\076\076    BBx
  2882. >7    string        \000            indexed file
  2883. >7    string        \001            serial file
  2884. >7    string        \002            keyed file
  2885. >>13    short        0            (sort)
  2886. >7    string        \004            program
  2887. >>18    byte        x            (LEVEL %d)
  2888. >>>23    string        >\000            psaved
  2889. >7    string        \006            mkeyed file
  2890. >>13    short        0            (sort)
  2891. >>8    string        \000            (mkey)
  2892. #------------------------------------------------------------------------------
  2893. # bFLT: file(1) magic for BFLT uclinux binary files
  2894. #
  2895. # From Philippe De Muyter <phdm@macqel.be>
  2896. #
  2897. 0    string        bFLT        BFLT executable
  2898. >4    belong        x        - version %ld
  2899. >4    belong        4
  2900. >>36    belong&0x1    0x1        ram
  2901. >>36    belong&0x2    0x2        gotpic
  2902. >>36    belong&0x4    0x4        gzip
  2903. >>36    belong&0x8    0x8        gzdata
  2904. #------------------------------------------------------------------------------
  2905. # blender: file(1) magic for Blender 3D related files
  2906. #
  2907. # Native format rule v1.2. For questions use the developers list 
  2908. # http://lists.blender.org/mailman/listinfo/bf-committers
  2909. # GLOB chunk was moved near start and provides subversion info since 2.42 
  2910.  
  2911. 0        string    =BLENDER    Blender3D,
  2912. >7        string    =_        saved as 32-bits
  2913. >>8        string    =v        little endian
  2914. >>>9        byte    x        with version %c.
  2915. >>>10        byte    x        \b%c
  2916. >>>11        byte    x        \b%c
  2917. >>>0x40        string    =GLOB        \b.
  2918. >>>>0x58    leshort    x        \b%.4d
  2919. >>8        string    =V        big endian
  2920. >>>9        byte    x        with version %c.
  2921. >>>10        byte    x        \b%c
  2922. >>>11        byte    x        \b%c
  2923. >>>0x40        string    =GLOB        \b.
  2924. >>>>0x58    beshort    x        \b%.4d
  2925. >7        string    =-        saved as 64-bits
  2926. >>8        string    =v        little endian
  2927. >>9        byte    x        with version %c.
  2928. >>10        byte    x        \b%c
  2929. >>11        byte    x        \b%c
  2930. >>0x44        string    =GLOB        \b.
  2931. >>>0x60        leshort    x        \b%.4d
  2932. >>8        string    =V        big endian
  2933. >>>9        byte    x        with version %c.
  2934. >>>10        byte    x        \b%c
  2935. >>>11        byte    x        \b%c
  2936. >>>0x44        string    =GLOB        \b.
  2937. >>>>0x60    beshort    x        \b%.4d
  2938.  
  2939. # Scripts that run in the embeded Python interpreter
  2940. 0        string    #!BPY        Blender3D BPython script
  2941.  
  2942. #------------------------------------------------------------------------------
  2943. # blit:  file(1) magic for 68K Blit stuff as seen from 680x0 machine
  2944. #
  2945. # Note that this 0407 conflicts with several other a.out formats...
  2946. #
  2947. # XXX - should this be redone with "be" and "le", so that it works on
  2948. # little-endian machines as well?  If so, what's the deal with
  2949. # "VAX-order" and "VAX-order2"?
  2950. #
  2951. #0    long        0407        68K Blit (standalone) executable
  2952. #0    short        0407        VAX-order2 68K Blit (standalone) executable
  2953. 0    short        03401        VAX-order 68K Blit (standalone) executable
  2954. 0    long        0406        68k Blit mpx/mux executable
  2955. 0    short        0406        VAX-order2 68k Blit mpx/mux executable
  2956. 0    short        03001        VAX-order 68k Blit mpx/mux executable
  2957. # Need more values for WE32 DMD executables.
  2958. # Note that 0520 is the same as COFF
  2959. #0    short        0520        tty630 layers executable
  2960. #
  2961. # i80960 b.out objects and archives
  2962. #
  2963. 0    long        0x10d        i960 b.out relocatable object
  2964. >16    long        >0        not stripped
  2965. #
  2966. # b.out archive (hp-rt on i960)
  2967. 0    string        =!<bout>    b.out archive
  2968. >8    string        __.SYMDEF    random library
  2969. #------------------------------------------------------------------------------
  2970. # bsdi:  file(1) magic for BSD/OS (from BSDI) objects
  2971. #
  2972.  
  2973. 0    lelong        0314        386 compact demand paged pure executable
  2974. >16    lelong        >0        not stripped
  2975. >32    byte        0x6a        (uses shared libs)
  2976.  
  2977. 0    lelong        0407        386 executable
  2978. >16    lelong        >0        not stripped
  2979. >32    byte        0x6a        (uses shared libs)
  2980.  
  2981. 0    lelong        0410        386 pure executable
  2982. >16    lelong        >0        not stripped
  2983. >32    byte        0x6a        (uses shared libs)
  2984.  
  2985. 0    lelong        0413        386 demand paged pure executable
  2986. >16    lelong        >0        not stripped
  2987. >32    byte        0x6a        (uses shared libs)
  2988.  
  2989. # same as in SunOS 4.x, except for static shared libraries
  2990. 0    belong&077777777    0600413        sparc demand paged
  2991. >0    byte        &0x80
  2992. >>20    belong        <4096        shared library
  2993. >>20    belong        =4096        dynamically linked executable
  2994. >>20    belong        >4096        dynamically linked executable
  2995. >0    byte        ^0x80        executable
  2996. >16    belong        >0        not stripped
  2997. >36    belong        0xb4100001    (uses shared libs)
  2998.  
  2999. 0    belong&077777777    0600410        sparc pure
  3000. >0    byte        &0x80        dynamically linked executable
  3001. >0    byte        ^0x80        executable
  3002. >16    belong        >0        not stripped
  3003. >36    belong        0xb4100001    (uses shared libs)
  3004.  
  3005. 0    belong&077777777    0600407        sparc
  3006. >0    byte        &0x80        dynamically linked executable
  3007. >0    byte        ^0x80        executable
  3008. >16    belong        >0        not stripped
  3009. >36    belong        0xb4100001    (uses shared libs)
  3010. #------------------------------------------------------------------------------
  3011. # BTSnoop:  file(1) magic for BTSnoop files
  3012. #
  3013. # From <marcel@holtmann.org>
  3014. 0    string        btsnoop\0        BTSnoop
  3015. >8    belong        x            version %d,
  3016. >12    belong        1001            Unencapsulated HCI
  3017. >12    belong        1002            HCI UART (H4)
  3018. >12    belong        1003            HCI BCSP
  3019. >12    belong        1004            HCI Serial (H5)
  3020. >>12    belong        x            type %d
  3021. #------------------------------------------------------------------------------
  3022. # c-lang:  file(1) magic for C programs (or REXX)
  3023. #
  3024.  
  3025. # XPM icons (Greg Roelofs, newt@uchicago.edu)
  3026. # if you uncomment "/*" for C/REXX below, also uncomment this entry
  3027. #0    string        /*\ XPM\ */    X pixmap image data
  3028. #!:mime    image/x-xpmi
  3029.  
  3030. # 3DS (3d Studio files) Conflicts with diff output 0x3d '='
  3031. #16    beshort        0x3d3d        image/x-3ds
  3032.  
  3033. # this first will upset you if you're a PL/1 shop...
  3034. # in which case rm it; ascmagic will catch real C programs
  3035. #0    search/1    /*        C or REXX program text
  3036. #0    search/1    //        C++ program text
  3037.  
  3038. # From: Mikhail Teterin <mi@aldan.algebra.com> 
  3039. 0    string        cscope        cscope reference data
  3040. >7    string        x        version %.2s
  3041. # We skip the path here, because it is often long (so file will
  3042. # truncate it) and mostly redundant.
  3043. # The inverted index functionality was added some time betwen
  3044. # versions 11 and 15, so look for -q if version is above 14:
  3045. >7    string        >14
  3046. >>10    search/100    \ -q\         with inverted index
  3047. >10    search/100    \ -c\         text (non-compressed)
  3048. #------------------------------------------------------------------------------
  3049. # c64:  file(1) magic for various commodore 64 related files
  3050. #
  3051. # From: Dirk Jagdmann <doj@cubic.org>
  3052.  
  3053. 0x16500    belong        0x12014100    D64 Image
  3054. 0x16500    belong        0x12014180    D71 Image
  3055. 0x61800 belong        0x28034400    D81 Image
  3056. 0    string        C64\40CARTRIDGE    CCS C64 Emultar Cartridge Image
  3057. 0    belong        0x43154164    X64 Image
  3058.  
  3059. 0    string        GCR-1541    GCR Image
  3060. >8    byte        x        version: %i
  3061. >9    byte        x        tracks: %i
  3062.  
  3063. 9    string        PSUR        ARC archive (c64)
  3064. 2    string        -LH1-        LHA archive (c64)
  3065.  
  3066. 0    string        C64File        PC64 Emulator file
  3067. >8    string        >\0        "%s"
  3068. 0    string        C64Image    PC64 Freezer Image
  3069.  
  3070. 0    beshort        0x38CD        C64 PCLink Image
  3071. 0    string        CBM\144\0\0    Power 64 C64 Emulator Snapshot
  3072.  
  3073. 0    belong        0xFF424CFF    WRAptor packer (c64)
  3074.  
  3075. 0    string        C64S\x20tape\x20file    T64 tape Image
  3076. >32    leshort        x        Version:0x%x
  3077. >36    leshort        !0        Entries:%i
  3078. >40    string        x        Name:%.24s
  3079.  
  3080. 0    string        C64\x20tape\x20image\x20file\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0    T64 tape Image
  3081. >32    leshort        x        Version:0x%x
  3082. >36    leshort        !0        Entries:%i
  3083. >40    string        x        Name:%.24s
  3084.  
  3085. 0    string        C64S\x20tape\x20image\x20file\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0    T64 tape Image
  3086. >32    leshort        x        Version:0x%x
  3087. >36    leshort        !0        Entries:%i
  3088. >40    string        x        Name:%.24s
  3089.  
  3090. #------------------------------------------------------------------------------
  3091. # autocad:  file(1) magic for cad files
  3092. #
  3093.  
  3094. # AutoCAD DWG versions R13/R14 (www.autodesk.com)
  3095. # Written December 01, 2003 by Lester Hightower
  3096. # Based on the DWG File Format Specifications at http://www.opendwg.org/
  3097. 0    string           \101\103\061\060\061           AutoCAD
  3098. >5    string           \062\000\000\000\000           DWG ver. R13
  3099. >5    string           \064\000\000\000\000           DWG ver. R14
  3100.  
  3101. # Microstation DGN/CIT Files (www.bentley.com)
  3102. # Last updated July 29, 2005 by Lester Hightower
  3103. # DGN is the default file extension of Microstation/Intergraph CAD files.
  3104. # CIT is the proprietary raster format (similar to TIFF) used to attach
  3105. # raster underlays to Microstation DGN (vector) drawings.
  3106. # http://www.wotsit.org/search.asp
  3107. # http://filext.com/detaillist.php?extdetail=DGN
  3108. # http://filext.com/detaillist.php?extdetail=CIT
  3109. #
  3110. # http://www.bentley.com/products/default.cfm?objectid=97F351F5-9C35-4E5E-89C2
  3111. # 3F86C928&method=display&p_objectid=97F351F5-9C35-4E5E-89C280A93F86C928
  3112. # http://www.bentley.com/products/default.cfm?objectid=A5C2FD43-3AC9-4C71-B682
  3113. # 721C479F&method=display&p_objectid=A5C2FD43-3AC9-4C71-B682C7BE721C479F
  3114. 0    string    \010\011\376            Microstation
  3115. >3    string    \002
  3116. >>30    string    \026\105            DGNFile
  3117. >>30    string    \034\105            DGNFile
  3118. >>30    string    \073\107            DGNFile
  3119. >>30    string    \073\110            DGNFile
  3120. >>30    string    \106\107            DGNFile
  3121. >>30    string    \110\103            DGNFile
  3122. >>30    string    \120\104            DGNFile
  3123. >>30    string    \172\104            DGNFile
  3124. >>30    string    \172\105            DGNFile
  3125. >>30    string    \172\106            DGNFile
  3126. >>30    string    \234\106            DGNFile
  3127. >>30    string    \273\105            DGNFile
  3128. >>30    string    \306\106            DGNFile
  3129. >>30    string    \310\104            DGNFile
  3130. >>30    string    \341\104            DGNFile
  3131. >>30    string    \372\103            DGNFile
  3132. >>30    string    \372\104            DGNFile
  3133. >>30    string    \372\106            DGNFile
  3134. >>30    string    \376\103            DGNFile
  3135. >4    string    \030\000\000            CITFile
  3136. >4    string    \030\000\003            CITFile
  3137.  
  3138. # AutoCad, from Nahuel Greco
  3139. # AutoCAD DWG versions R12/R13/R14 (www.autodesk.com)
  3140. 0    string AC1012    AutoCad (release 12)
  3141. 0    string AC1013    AutoCad (release 13)
  3142. 0    string AC1014    AutoCad (release 14)
  3143.  
  3144. # CAD: file(1) magic for computer aided design files
  3145. # Phillip Griffith <phillip dot griffith at gmail dot com>
  3146. # AutoCAD magic taken from the Open Design Alliance's OpenDWG specifications.
  3147. #
  3148. 0    belong    0x08051700    Bentley/Intergraph MicroStation DGN cell library
  3149. 0    belong    0x0809fe02    Bentley/Intergraph MicroStation DGN vector CAD
  3150. 0    belong    0xc809fe02    Bentley/Intergraph MicroStation DGN vector CAD
  3151. 0    beshort    0x0809        Bentley/Intergraph MicroStation
  3152. >0x02    byte    0xfe
  3153. >>0x04    beshort    0x1800        CIT raster CAD
  3154. 0    string    AC1012        AutoDesk AutoCAD R13
  3155. 0    string    AC1014        AutoDesk AutoCAD R14 
  3156. 0    string    AC1015        AutoDesk AutoCAD R2000
  3157. #------------------------------------------------------------------------------
  3158. # Cafe Babes unite!
  3159. #
  3160. # Since Java bytecode and Mach-O fat-files have the same magic number, the test
  3161. # must be performed in the same "magic" sequence to get both right.  The long
  3162. # at offset 4 in a mach-O fat file tells the number of architectures; the short at
  3163. # offset 4 in a Java bytecode file is the JVM minor version and the
  3164. # short at offset 6 is the JVM major version.  Since there are only 
  3165. # only 18 labeled Mach-O architectures at current, and the first released 
  3166. # Java class format was version 43.0, we can safely choose any number
  3167. # between 18 and 39 to test the number of architectures against
  3168. # (and use as a hack). Let's not use 18, because the Mach-O people
  3169. # might add another one or two as time goes by...
  3170. #
  3171. 0    beshort        0xcafe
  3172. >2    beshort         0xbabe
  3173. !:mime    application/x-java-applet
  3174. >>4    belong        >30        compiled Java class data,
  3175. >>>6    beshort        x            version %d.
  3176. >>>4    beshort        x           \b%d
  3177. >>4    belong        1        Mach-O fat file with 1 architecture
  3178. >>4    belong        >1
  3179. >>>4    belong        <20        Mach-O fat file with %ld architectures
  3180. >2    beshort        0xd00d        JAR compressed with pack200,
  3181. >>5    byte        x        version %d.
  3182. >>4    byte        x        \b%d
  3183. !:mime    application/x-java-pack200
  3184. #------------------------------------------------------------------------------
  3185. # CDDB: file(1) magic for CDDB(tm) format CD text data files
  3186. #
  3187. # From <steve@gracenote.com>
  3188. #
  3189. # This is the /etc/magic entry to decode datafiles as used by
  3190. # CDDB-enabled CD player applications.
  3191. #
  3192.  
  3193. 0    search/1/b    #\040xmcd    CDDB(tm) format CD text data
  3194.  
  3195. #------------------------------------------------------------------------------
  3196. # chord: file(1) magic for Chord music sheet typesetting utility input files
  3197. #
  3198. # From Philippe De Muyter <phdm@macqel.be>
  3199. # File format is actually free, but many distributed files begin with `{title'
  3200. #
  3201. 0    string        {title        Chord text file
  3202.  
  3203. # Type:    PowerTab file format
  3204. # URL:    http://www.power-tab.net/
  3205. # From:    Jelmer Vernooij <jelmer@samba.org>
  3206. 0    string        ptab\003\000    Power-Tab v3 Tablature File
  3207. 0    string        ptab\004\000    Power-Tab v4 Tablature File
  3208. #------------------------------------------------------------------------------
  3209. # cisco:  file(1) magic for cisco Systems routers
  3210. #
  3211. # Most cisco file-formats are covered by the generic elf code
  3212. #
  3213. # Microcode files are non-ELF, 0x8501 conflicts with NetBSD/alpha.
  3214. 0    belong&0xffffff00    0x85011400  cisco IOS microcode
  3215. >7    string        >\0            for '%s'
  3216. 0    belong&0xffffff00    0x8501cb00  cisco IOS experimental microcode
  3217. >7    string        >\0            for '%s'
  3218. #------------------------------------------------------------------------------
  3219. # citrus locale declaration
  3220. #
  3221.  
  3222. 0    string        RuneCT        Citrus locale declaration for LC_CTYPE
  3223.  
  3224.  
  3225. #------------------------------------------------------------------------------
  3226. # clarion:  file(1) magic for # Clarion Personal/Professional Developer
  3227. # (v2 and above)
  3228. # From: Julien Blache <jb@jblache.org>
  3229.  
  3230. # Database files
  3231. # signature
  3232. 0    leshort    0x3343    Clarion Developer (v2 and above) data file
  3233. # attributes
  3234. >2    leshort    &0x0001    \b, locked
  3235. >2    leshort    &0x0004    \b, encrypted
  3236. >2    leshort    &0x0008    \b, memo file exists
  3237. >2    leshort    &0x0010    \b, compressed
  3238. >2    leshort    &0x0040    \b, read only
  3239. # number of records
  3240. >5    lelong    x    \b, %ld records
  3241.  
  3242. # Memo files
  3243. 0    leshort    0x334d    Clarion Developer (v2 and above) memo data
  3244.  
  3245. # Key/Index files
  3246. # No magic? :(
  3247.  
  3248. # Help files
  3249. 0    leshort    0x49e0    Clarion Developer (v2 and above) help data
  3250.  
  3251. #------------------------------------------------------------------------------
  3252. # claris:  file(1) magic for claris
  3253. # "H. Nanosecond" <aldomel@ix.netcom.com>
  3254. # Claris Works a word processor, etc.
  3255. # Version 3.0
  3256.  
  3257. # .pct claris works clip art files
  3258. #0000000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
  3259. #*
  3260. #0001000 #010 250 377 377 377 377 000 213 000 230 000 021 002 377 014 000
  3261. #null to byte 1000 octal
  3262. 514    string    \377\377\377\377\000    Claris clip art?
  3263. >0    string    \0\0\0\0\0\0\0\0\0\0\0\0\0    yes.
  3264. 514    string    \377\377\377\377\001    Claris clip art?
  3265. >0    string    \0\0\0\0\0\0\0\0\0\0\0\0\0    yes.
  3266.  
  3267. # Claris works files
  3268. # .cwk
  3269. 0    string    \002\000\210\003\102\117\102\117\000\001\206 Claris works document
  3270. # .plt
  3271. 0    string    \020\341\000\000\010\010    Claris Works pallete files .plt
  3272.  
  3273. # .msp a dictionary file I am not sure about this I have only one .msp file
  3274. 0    string    \002\271\262\000\040\002\000\164    Claris works dictionary
  3275.  
  3276. # .usp are user dictionary bits
  3277. # I am not sure about a magic header:
  3278. #0000000 001 123 160 146 070 125 104 040 136 123 015 012 160 157 144 151
  3279. #        soh   S   p   f   8   U   D  sp   ^   S  cr  nl   p   o   d   i
  3280. #0000020 141 164 162 151 163 164 040 136 123 015 012 144 151 166 040 043
  3281. #          a   t   r   i   s   t  sp   ^   S  cr  nl   d   i   v  sp   #
  3282.  
  3283. # .mth Thesaurus
  3284. # starts with \0 but no magic header
  3285.  
  3286. # .chy Hyphenation file
  3287. # I am not sure: 000 210 034 000 000
  3288.  
  3289. # other claris files
  3290. #./windows/claris/useng.ndx: data
  3291. #./windows/claris/xtndtran.l32: data
  3292. #./windows/claris/xtndtran.lst: data
  3293. #./windows/claris/clworks.lbl: data
  3294. #./windows/claris/clworks.prf: data
  3295. #./windows/claris/userd.spl: data
  3296.  
  3297. #------------------------------------------------------------------------------
  3298. # clipper:  file(1) magic for Intergraph (formerly Fairchild) Clipper.
  3299. #
  3300. # XXX - what byte order does the Clipper use?
  3301. #
  3302. # XXX - what's the "!" stuff:
  3303. #
  3304. # >18    short        !074000,000000    C1 R1 
  3305. # >18    short        !074000,004000    C2 R1
  3306. # >18    short        !074000,010000    C3 R1
  3307. # >18    short        !074000,074000    TEST
  3308. #
  3309. # I shall assume it's ANDing the field with the first value and
  3310. # comparing it with the second, and rewrite it as:
  3311. #
  3312. # >18    short&074000    000000        C1 R1 
  3313. # >18    short&074000    004000        C2 R1
  3314. # >18    short&074000    010000        C3 R1
  3315. # >18    short&074000    074000        TEST
  3316. #
  3317. # as SVR3.1's "file" doesn't support anything of the "!074000,000000"
  3318. # sort, nor does SunOS 4.x, so either it's something Intergraph added
  3319. # in CLIX, or something AT&T added in SVR3.2 or later, or something
  3320. # somebody else thought was a good idea; it's not documented in the
  3321. # man page for this version of "magic", nor does it appear to be
  3322. # implemented (at least not after I blew off the bogus code to turn
  3323. # old-style "&"s into new-style "&"s, which just didn't work at all).
  3324. #
  3325. 0    short        0575        CLIPPER COFF executable (VAX #)
  3326. >20    short        0407        (impure)
  3327. >20    short        0410        (5.2 compatible)
  3328. >20    short        0411        (pure)
  3329. >20    short        0413        (demand paged)
  3330. >20    short        0443        (target shared library)
  3331. >12    long        >0        not stripped
  3332. >22    short        >0        - version %ld
  3333. 0    short        0577        CLIPPER COFF executable
  3334. >18    short&074000    000000        C1 R1 
  3335. >18    short&074000    004000        C2 R1
  3336. >18    short&074000    010000        C3 R1
  3337. >18    short&074000    074000        TEST
  3338. >20    short        0407        (impure)
  3339. >20    short        0410        (pure)
  3340. >20    short        0411        (separate I&D)
  3341. >20    short        0413        (paged)
  3342. >20    short        0443        (target shared library)
  3343. >12    long        >0        not stripped
  3344. >22    short        >0        - version %ld
  3345. >48    long&01        01        alignment trap enabled
  3346. >52    byte        1        -Ctnc
  3347. >52    byte        2        -Ctsw
  3348. >52    byte        3        -Ctpw
  3349. >52    byte        4        -Ctcb
  3350. >53    byte        1        -Cdnc
  3351. >53    byte        2        -Cdsw
  3352. >53    byte        3        -Cdpw
  3353. >53    byte        4        -Cdcb
  3354. >54    byte        1        -Csnc
  3355. >54    byte        2        -Cssw
  3356. >54    byte        3        -Cspw
  3357. >54    byte        4        -Cscb
  3358. 4    string        pipe        CLIPPER instruction trace
  3359. 4    string        prof        CLIPPER instruction profile
  3360.  
  3361. #------------------------------------------------------------------------------
  3362. # commands:  file(1) magic for various shells and interpreters
  3363. #
  3364. #0    string        :            shell archive or script for antique kernel text
  3365. 0    string/b    #!\ /bin/sh        POSIX shell script text executable
  3366. !:mime    text/x-shellscript
  3367. 0    string/b    #!\ /bin/csh        C shell script text executable
  3368. !:mime    text/x-shellscript
  3369. # korn shell magic, sent by George Wu, gwu@clyde.att.com
  3370. 0    string/b    #!\ /bin/ksh        Korn shell script text executable
  3371. !:mime    text/x-shellscript
  3372. 0    string/b     #!\ /bin/tcsh        Tenex C shell script text executable
  3373. !:mime    text/x-shellscript
  3374. 0    string/b    #!\ /usr/bin/tcsh    Tenex C shell script text executable
  3375. !:mime    text/x-shellscript
  3376. 0    string/b     #!\ /usr/local/tcsh    Tenex C shell script text executable
  3377. !:mime    text/x-shellscript
  3378. 0    string/b    #!\ /usr/local/bin/tcsh    Tenex C shell script text executable
  3379. !:mime    text/x-shellscript
  3380.  
  3381. #
  3382. # zsh/ash/ae/nawk/gawk magic from cameron@cs.unsw.oz.au (Cameron Simpson)
  3383. 0    string/b    #!\ /bin/zsh        Paul Falstad's zsh script text executable
  3384. !:mime    text/x-shellscript
  3385. 0    string/b    #!\ /usr/bin/zsh    Paul Falstad's zsh script text executable
  3386. !:mime    text/x-shellscript
  3387. 0    string/b    #!\ /usr/local/bin/zsh    Paul Falstad's zsh script text executable
  3388. !:mime    text/x-shellscript
  3389. 0    string/b    #!\ /usr/local/bin/ash    Neil Brown's ash script text executable
  3390. !:mime    text/x-shellscript
  3391. 0    string/b    #!\ /usr/local/bin/ae    Neil Brown's ae script text executable
  3392. !:mime    text/x-shellscript
  3393. 0    string/b    #!\ /bin/nawk        new awk script text executable
  3394. !:mime    text/x-nawk
  3395. 0    string/b    #!\ /usr/bin/nawk    new awk script text executable
  3396. !:mime    text/x-nawk
  3397. 0    string/b    #!\ /usr/local/bin/nawk    new awk script text executable
  3398. !:mime    text/x-nawk
  3399. 0    string/b    #!\ /bin/gawk        GNU awk script text executable
  3400. !:mime    text/x-gawk
  3401. 0    string/b    #!\ /usr/bin/gawk    GNU awk script text executable
  3402. !:mime    text/x-gawk
  3403. 0    string/b    #!\ /usr/local/bin/gawk    GNU awk script text executable
  3404. !:mime    text/x-gawk
  3405. #
  3406. 0    string/b    #!\ /bin/awk        awk script text executable
  3407. !:mime    text/x-awk
  3408. 0    string/b    #!\ /usr/bin/awk    awk script text executable
  3409. !:mime    text/x-awk
  3410. # update to distinguish from *.vcf files
  3411. # this is broken because postscript has /EBEGIN{ for example.
  3412. #0    search/Bb    BEGIN {            awk script text
  3413. 0    regex        =^\\s*BEGIN\\s*[{]    awk script text
  3414.  
  3415. # AT&T Bell Labs' Plan 9 shell
  3416. 0    string/b    #!\ /bin/rc    Plan 9 rc shell script text executable
  3417.  
  3418. # bash shell magic, from Peter Tobias (tobias@server.et-inf.fho-emden.de)
  3419. 0    string/b    #!\ /bin/bash    Bourne-Again shell script text executable
  3420. !:mime    text/x-shellscript
  3421. 0    string/b    #!\ /usr/bin/bash    Bourne-Again shell script text executable
  3422. !:mime text/x-shellscript
  3423. 0    string/b    #!\ /usr/local/bash    Bourne-Again shell script text executable
  3424. !:mime text/x-shellscript
  3425. 0    string/b    #!\ /usr/local/bin/bash    Bourne-Again shell script text executable
  3426. !:mime    text/x-shellscript
  3427.  
  3428. # using env
  3429. 0    string        #!/usr/bin/env        a
  3430. >15    string        >\0            %s script text executable
  3431. 0    string        #!\ /usr/bin/env    a
  3432. >16    string        >\0            %s script text executable
  3433.  
  3434. # PHP scripts
  3435. # Ulf Harnhammar <ulfh@update.uu.se>
  3436. 0    search/1/c    =<?php            PHP script text
  3437. !:mime    text/x-php
  3438. 0    search/1    =<?\n            PHP script text
  3439. !:mime    text/x-php
  3440. 0    search/1    =<?\r            PHP script text
  3441. !:mime    text/x-php
  3442. 0    search/1/b    #!\ /usr/local/bin/php    PHP script text executable
  3443. !:mime    text/x-php
  3444. 0    search/1/b    #!\ /usr/bin/php    PHP script text executable
  3445. !:mime    text/x-php
  3446.  
  3447. 0    string        Zend\x00        PHP script Zend Optimizer data
  3448.  
  3449. 0    string        $!            DCL command file
  3450.  
  3451. # Type: Pdmenu
  3452. # URL:  http://packages.debian.org/pdmenu
  3453. # From: Edward Betts <edward@debian.org>
  3454. 0    string    #!/usr/bin/pdmenu    Pdmenu configuration file text
  3455.  
  3456. #----------------------------------------------------------------------------
  3457. # communication
  3458.  
  3459. # TTCN is the Tree and Tabular Combined Notation described in ISO 9646-3.
  3460. # It is used for conformance testing of communication protocols.
  3461. # Added by W. Borgert <debacle@debian.org>.
  3462. 0    string        $Suite            TTCN Abstract Test Suite
  3463. >&1    string        $SuiteId
  3464. >>&1    string        >\n            %s
  3465. >&2    string        $SuiteId
  3466. >>&1    string        >\n            %s
  3467. >&3    string        $SuiteId
  3468. >>&1    string        >\n            %s
  3469.  
  3470. # MSC (message sequence charts) are a formal description technique,
  3471. # described in ITU-T Z.120, mainly used for communication protocols.
  3472. # Added by W. Borgert <debacle@debian.org>.
  3473. 0    string        mscdocument    Message Sequence Chart (document)
  3474. 0    string        msc        Message Sequence Chart (chart)
  3475. 0    string        submsc        Message Sequence Chart (subchart)
  3476.  
  3477. #------------------------------------------------------------------------------
  3478. # compress:  file(1) magic for pure-compression formats (no archives)
  3479. #
  3480. # compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, etc.
  3481. #
  3482. # Formats for various forms of compressed data
  3483. # Formats for "compress" proper have been moved into "compress.c",
  3484. # because it tries to uncompress it to figure out what's inside.
  3485.  
  3486. # standard unix compress
  3487. 0    string        \037\235    compress'd data
  3488. !:mime    application/x-compress
  3489. >2    byte&0x80    >0        block compressed
  3490. >2    byte&0x1f    x        %d bits
  3491.  
  3492. # gzip (GNU zip, not to be confused with Info-ZIP or PKWARE zip archiver)
  3493. #   Edited by Chris Chittleborough <cchittleborough@yahoo.com.au>, March 2002
  3494. #    * Original filename is only at offset 10 if "extra field" absent
  3495. #    * Produce shorter output - notably, only report compression methods
  3496. #      other than 8 ("deflate", the only method defined in RFC 1952).
  3497. 0       string          \037\213        gzip compressed data
  3498. !:mime    application/x-gzip
  3499. >2    byte        <8        \b, reserved method
  3500. >2    byte        >8        \b, unknown method
  3501. >3    byte        &0x01        \b, ASCII
  3502. >3    byte        &0x02        \b, has CRC
  3503. >3    byte        &0x04        \b, extra field
  3504. >3    byte&0xC    =0x08
  3505. >>10    string        x        \b, was "%s"
  3506. >3    byte        &0x10        \b, has comment
  3507. >9    byte        =0x00        \b, from FAT filesystem (MS-DOS, OS/2, NT)
  3508. >9    byte        =0x01        \b, from Amiga
  3509. >9    byte        =0x02        \b, from VMS
  3510. >9    byte        =0x03        \b, from Unix
  3511. >9    byte        =0x04        \b, from VM/CMS
  3512. >9    byte        =0x05        \b, from Atari
  3513. >9    byte        =0x06        \b, from HPFS filesystem (OS/2, NT)
  3514. >9    byte        =0x07        \b, from MacOS
  3515. >9    byte        =0x08        \b, from Z-System
  3516. >9    byte        =0x09        \b, from CP/M
  3517. >9    byte        =0x0A        \b, from TOPS/20
  3518. >9    byte        =0x0B        \b, from NTFS filesystem (NT)
  3519. >9    byte        =0x0C        \b, from QDOS
  3520. >9    byte        =0x0D        \b, from Acorn RISCOS
  3521. >3    byte        &0x10        \b, comment
  3522. >3    byte        &0x20        \b, encrypted
  3523. >4    ledate        >0        \b, last modified: %s
  3524. >8    byte        2        \b, max compression
  3525. >8    byte        4        \b, max speed
  3526.  
  3527. # packed data, Huffman (minimum redundancy) codes on a byte-by-byte basis
  3528. 0    string        \037\036    packed data
  3529. !:mime    application/octet-stream
  3530. >2    belong        >1        \b, %d characters originally
  3531. >2    belong        =1        \b, %d character originally
  3532. #
  3533. # This magic number is byte-order-independent.
  3534. 0    short        0x1f1f        old packed data
  3535. !:mime    application/octet-stream
  3536.  
  3537. # XXX - why *two* entries for "compacted data", one of which is
  3538. # byte-order independent, and one of which is byte-order dependent?
  3539. #
  3540. 0    short        0x1fff        compacted data
  3541. !:mime    application/octet-stream
  3542. # This string is valid for SunOS (BE) and a matching "short" is listed
  3543. # in the Ultrix (LE) magic file.
  3544. 0    string        \377\037    compacted data
  3545. !:mime    application/octet-stream
  3546. 0    short        0145405        huf output
  3547. !:mime    application/octet-stream
  3548.  
  3549. # bzip2
  3550. 0    string        BZh        bzip2 compressed data
  3551. !:mime    application/x-bzip2
  3552. >3    byte        >47        \b, block size = %c00k
  3553.  
  3554. # squeeze and crunch
  3555. # Michael Haardt <michael@cantor.informatik.rwth-aachen.de>
  3556. 0    beshort        0x76FF        squeezed data,
  3557. >4    string        x        original name %s
  3558. 0    beshort        0x76FE        crunched data,
  3559. >2    string        x        original name %s
  3560. 0    beshort        0x76FD        LZH compressed data,
  3561. >2    string        x        original name %s
  3562.  
  3563. # Freeze
  3564. 0    string        \037\237    frozen file 2.1
  3565. 0    string        \037\236    frozen file 1.0 (or gzip 0.5)
  3566.  
  3567. # SCO compress -H (LZH)
  3568. 0    string        \037\240    SCO compress -H (LZH) data
  3569.  
  3570. # European GSM 06.10 is a provisional standard for full-rate speech
  3571. # transcoding, prI-ETS 300 036, which uses RPE/LTP (residual pulse
  3572. # excitation/long term prediction) coding at 13 kbit/s.
  3573. #
  3574. # There's only a magic nibble (4 bits); that nibble repeats every 33
  3575. # bytes.  This isn't suited for use, but maybe we can use it someday.
  3576. #
  3577. # This will cause very short GSM files to be declared as data and
  3578. # mismatches to be declared as data too!
  3579. #0    byte&0xF0    0xd0        data
  3580. #>33    byte&0xF0    0xd0
  3581. #>66    byte&0xF0    0xd0
  3582. #>99    byte&0xF0    0xd0
  3583. #>132    byte&0xF0    0xd0        GSM 06.10 compressed audio
  3584.  
  3585. # bzip    a block-sorting file compressor
  3586. #    by Julian Seward <sewardj@cs.man.ac.uk> and others
  3587. #
  3588. #0    string        BZ        bzip compressed data
  3589. #>2    byte        x        \b, version: %c
  3590. #>3    string        =1        \b, compression block size 100k
  3591. #>3    string        =2        \b, compression block size 200k
  3592. #>3    string        =3        \b, compression block size 300k
  3593. #>3    string        =4        \b, compression block size 400k
  3594. #>3    string        =5        \b, compression block size 500k
  3595. #>3    string        =6        \b, compression block size 600k
  3596. #>3    string        =7        \b, compression block size 700k
  3597. #>3    string        =8        \b, compression block size 800k
  3598. #>3    string        =9        \b, compression block size 900k
  3599.  
  3600. # lzop from <markus.oberhumer@jk.uni-linz.ac.at>
  3601. 0    string        \x89\x4c\x5a\x4f\x00\x0d\x0a\x1a\x0a    lzop compressed data
  3602. >9    beshort        <0x0940
  3603. >>9    byte&0xf0    =0x00        - version 0.
  3604. >>9    beshort&0x0fff    x        \b%03x,
  3605. >>13    byte        1        LZO1X-1,
  3606. >>13    byte        2        LZO1X-1(15),
  3607. >>13    byte        3        LZO1X-999,
  3608. ## >>22    bedate        >0        last modified: %s,
  3609. >>14    byte        =0x00        os: MS-DOS
  3610. >>14    byte        =0x01        os: Amiga
  3611. >>14    byte        =0x02        os: VMS
  3612. >>14    byte        =0x03        os: Unix
  3613. >>14    byte        =0x05        os: Atari
  3614. >>14    byte        =0x06        os: OS/2
  3615. >>14    byte        =0x07        os: MacOS
  3616. >>14    byte        =0x0A        os: Tops/20
  3617. >>14    byte        =0x0B        os: WinNT
  3618. >>14    byte        =0x0E        os: Win32
  3619. >9    beshort        >0x0939
  3620. >>9    byte&0xf0    =0x00        - version 0.
  3621. >>9    byte&0xf0    =0x10        - version 1.
  3622. >>9    byte&0xf0    =0x20        - version 2.
  3623. >>9    beshort&0x0fff    x        \b%03x,
  3624. >>15    byte        1        LZO1X-1,
  3625. >>15    byte        2        LZO1X-1(15),
  3626. >>15    byte        3        LZO1X-999,
  3627. ## >>25    bedate        >0        last modified: %s,
  3628. >>17    byte        =0x00        os: MS-DOS
  3629. >>17    byte        =0x01        os: Amiga
  3630. >>17    byte        =0x02        os: VMS
  3631. >>17    byte        =0x03        os: Unix
  3632. >>17    byte        =0x05        os: Atari
  3633. >>17    byte        =0x06        os: OS/2
  3634. >>17    byte        =0x07        os: MacOS
  3635. >>17    byte        =0x0A        os: Tops/20
  3636. >>17    byte        =0x0B        os: WinNT
  3637. >>17    byte        =0x0E        os: Win32
  3638.  
  3639. # 4.3BSD-Quasijarus Strong Compression
  3640. # http://minnie.tuhs.org/Quasijarus/compress.html
  3641. 0    string        \037\241    Quasijarus strong compressed data
  3642.  
  3643. # From: Cory Dikkers <cdikkers@swbell.net>
  3644. 0    string        XPKF        Amiga xpkf.library compressed data
  3645. 0    string        PP11        Power Packer 1.1 compressed data
  3646. 0    string        PP20        Power Packer 2.0 compressed data,
  3647. >4    belong        0x09090909    fast compression
  3648. >4    belong        0x090A0A0A    mediocre compression
  3649. >4    belong        0x090A0B0B    good compression
  3650. >4    belong        0x090A0C0C    very good compression
  3651. >4    belong        0x090A0C0D    best compression
  3652.  
  3653. # 7-zip archiver, from Thomas Klausner (wiz@danbala.tuwien.ac.at)
  3654. # http://www.7-zip.org or DOC/7zFormat.txt 
  3655. #
  3656. 0    string        7z\274\257\047\034    7-zip archive data,
  3657. >6    byte        x            version %d
  3658. >7    byte        x            \b.%d
  3659.  
  3660. # Type: LZMA
  3661. # URL:  http://www.7-zip.org/sdk.html
  3662. # From: Robert Millan <rmh@aybabtu.com> and Reuben Thomas <rrt@sc3d.org>
  3663. # Commented out because apparently not reliable (according to Debian
  3664. # bug #364260)
  3665. #0    string        ]\000\000\200\000    LZMA compressed data
  3666.  
  3667. # AFX compressed files (Wolfram Kleff)
  3668. 2    string        -afx-        AFX compressed file data
  3669.  
  3670. # Supplementary magic data for the file(1) command to support
  3671. # rzip(1).  The format is described in magic(5).
  3672. #
  3673. # Copyright (C) 2003 by Andrew Tridgell.  You may do whatever you want with
  3674. # this file.
  3675. #
  3676. 0    string        RZIP        rzip compressed data
  3677. >4    byte        x        - version %d
  3678. >5    byte        x        \b.%d
  3679. >6    belong        x        (%d bytes)
  3680. #------------------------------------------------------------------------------
  3681. # Console game magic
  3682. # Toby Deshane <hac@shoelace.digivill.net>
  3683. #    ines:  file(1) magic for Marat's iNES Nintendo Entertainment System
  3684. #           ROM dump format
  3685.  
  3686. 0 string NES\032 iNES ROM dump,
  3687. >4 byte  x     %dx16k PRG
  3688. >5 byte  x     \b, %dx8k CHR
  3689. >6 byte&0x01  =0x1  \b, [Vert.]
  3690. >6 byte&0x01  =0x0  \b, [Horiz.]
  3691. >6 byte&0x02  =0x2  \b, [SRAM]
  3692. >6 byte&0x04  =0x4  \b, [Trainer]
  3693. >6 byte&0x04  =0x8  \b, [4-Scr]
  3694.  
  3695. #------------------------------------------------------------------------------
  3696. # gameboy:  file(1) magic for the Nintendo (Color) Gameboy raw ROM format
  3697. #
  3698. 0x104 belong 0xCEED6666 Gameboy ROM:
  3699. >0x134 string >\0 "%.16s"
  3700. >0x146 byte 0x03  \b,[SGB]
  3701. >0x147 byte 0x00  \b, [ROM ONLY]
  3702. >0x147 byte 0x01  \b, [ROM+MBC1]
  3703. >0x147 byte 0x02  \b, [ROM+MBC1+RAM]
  3704. >0x147 byte 0x03  \b, [ROM+MBC1+RAM+BATT]
  3705. >0x147 byte 0x05  \b, [ROM+MBC2]
  3706. >0x147 byte 0x06  \b, [ROM+MBC2+BATTERY]
  3707. >0x147 byte 0x08  \b, [ROM+RAM]
  3708. >0x147 byte 0x09  \b, [ROM+RAM+BATTERY]
  3709. >0x147 byte 0x0B  \b, [ROM+MMM01]
  3710. >0x147 byte 0x0C  \b, [ROM+MMM01+SRAM]
  3711. >0x147 byte 0x0D  \b, [ROM+MMM01+SRAM+BATT]
  3712. >0x147 byte 0x0F  \b, [ROM+MBC3+TIMER+BATT]
  3713. >0x147 byte 0x10  \b, [ROM+MBC3+TIMER+RAM+BATT]
  3714. >0x147 byte 0x11  \b, [ROM+MBC3]
  3715. >0x147 byte 0x12  \b, [ROM+MBC3+RAM]
  3716. >0x147 byte 0x13  \b, [ROM+MBC3+RAM+BATT]
  3717. >0x147 byte 0x19  \b, [ROM+MBC5]
  3718. >0x147 byte 0x1A  \b, [ROM+MBC5+RAM]
  3719. >0x147 byte 0x1B  \b, [ROM+MBC5+RAM+BATT]
  3720. >0x147 byte 0x1C  \b, [ROM+MBC5+RUMBLE]
  3721. >0x147 byte 0x1D  \b, [ROM+MBC5+RUMBLE+SRAM]
  3722. >0x147 byte 0x1E  \b, [ROM+MBC5+RUMBLE+SRAM+BATT]
  3723. >0x147 byte 0x1F  \b, [Pocket Camera]
  3724. >0x147 byte 0xFD  \b, [Bandai TAMA5]
  3725. >0x147 byte 0xFE  \b, [Hudson HuC-3]
  3726. >0x147 byte 0xFF  \b, [Hudson HuC-1]
  3727.  
  3728. >0x148 byte 0     \b, ROM: 256Kbit
  3729. >0x148 byte 1     \b, ROM: 512Kbit
  3730. >0x148 byte 2     \b, ROM: 1Mbit
  3731. >0x148 byte 3     \b, ROM: 2Mbit
  3732. >0x148 byte 4     \b, ROM: 4Mbit
  3733. >0x148 byte 5     \b, ROM: 8Mbit
  3734. >0x148 byte 6     \b, ROM: 16Mbit
  3735. >0x148 byte 0x52  \b, ROM: 9Mbit
  3736. >0x148 byte 0x53  \b, ROM: 10Mbit
  3737. >0x148 byte 0x54  \b, ROM: 12Mbit
  3738.  
  3739. >0x149 byte 1     \b, RAM: 16Kbit
  3740. >0x149 byte 2     \b, RAM: 64Kbit
  3741. >0x149 byte 3     \b, RAM: 128Kbit
  3742. >0x149 byte 4     \b, RAM: 1Mbit
  3743.  
  3744. #>0x14e long  x     \b, CRC: %x
  3745.  
  3746. #------------------------------------------------------------------------------
  3747. # genesis:  file(1) magic for the Sega MegaDrive/Genesis raw ROM format
  3748. #
  3749. 0x100 string SEGA  Sega MegaDrive/Genesis raw ROM dump
  3750. >0x120 string >\0 Name: "%.16s"
  3751. >0x110 string >\0 %.16s
  3752. >0x1B0 string RA with SRAM
  3753.  
  3754. #------------------------------------------------------------------------------
  3755. # genesis:  file(1) magic for the Super MegaDrive ROM dump format
  3756. #
  3757. 0x280 string EAGN  Super MagicDrive ROM dump
  3758. >0 byte x %dx16k blocks
  3759. >2 byte 0 \b, last in series or standalone
  3760. >2 byte >0 \b, split ROM
  3761. >8 byte 0xAA
  3762. >9 byte 0xBB
  3763.  
  3764. #------------------------------------------------------------------------------
  3765. # genesis:  file(1) alternate magic for the Super MegaDrive ROM dump format
  3766. #
  3767. 0x280 string EAMG  Super MagicDrive ROM dump
  3768. >0 byte x %dx16k blocks
  3769. >2 byte x \b, last in series or standalone
  3770. >8 byte 0xAA
  3771. >9 byte 0xBB
  3772.  
  3773. #------------------------------------------------------------------------------
  3774. # smsgg:  file(1) magic for Sega Master System and Game Gear ROM dumps
  3775. #
  3776. # Does not detect all images.  Very preliminary guesswork.  Need more data
  3777. # on format.
  3778. #
  3779. # FIXME: need a little more info...;P
  3780. #
  3781. #0 byte 0xF3
  3782. #>1 byte 0xED  Sega Master System/Game Gear ROM dump
  3783. #>1 byte 0x31  Sega Master System/Game Gear ROM dump
  3784. #>1 byte 0xDB  Sega Master System/Game Gear ROM dump
  3785. #>1 byte 0xAF  Sega Master System/Game Gear ROM dump
  3786. #>1 byte 0xC3  Sega Master System/Game Gear ROM dump
  3787.  
  3788. #------------------------------------------------------------------------------
  3789. # dreamcast:  file(1) uncertain magic for the Sega Dreamcast VMU image format
  3790. #
  3791. 0 belong 0x21068028   Sega Dreamcast VMU game image
  3792. 0 string LCDi         Dream Animator file
  3793.  
  3794. #------------------------------------------------------------------------------
  3795. # v64: file(1) uncertain magic for the V64 format N64 ROM dumps
  3796. #
  3797. 0 belong 0x37804012    V64 Nintendo 64 ROM dump
  3798.  
  3799. # From: "Nelson A. de Oliveira" <naoliv@gmail.com>
  3800. # Nintendo .nds
  3801. 192    string    \044\377\256Qi\232    Nintendo DS Game ROM Image
  3802. # Nintendo .gba
  3803. 0    string    \056\000\000\352$\377\256Qi    Nintendo Game Boy Advance ROM Image
  3804.  
  3805. #------------------------------------------------------------------------------
  3806. # msx: file(1) magic for MSX game cartridge dumps
  3807. # Too simple - MPi
  3808. #0 beshort 0x4142 MSX game cartridge dump 
  3809.  
  3810. #------------------------------------------------------------------------------
  3811. # Sony Playstation executables (Adam Sjoegren <asjo@diku.dk>) :
  3812. 0    string    PS-X\ EXE    Sony Playstation executable
  3813. #  Area:
  3814. >113    string    x        (%s)
  3815.  
  3816. #------------------------------------------------------------------------------
  3817. # Microsoft Xbox executables .xbe (Esa Hyyti√§ <ehyytia@cc.hut.fi>)
  3818. 0       string          XBEH            XBE, Microsoft Xbox executable
  3819. # probabilistic checks whether signed or not
  3820. >0x0004 ulelong =0x0
  3821. >>&2    ulelong =0x0
  3822. >>>&2   ulelong =0x0  \b, not signed
  3823. >0x0004 ulelong >0
  3824. >>&2    ulelong >0
  3825. >>>&2   ulelong >0    \b, signed
  3826. # expect base address of 0x10000
  3827. >0x0104               ulelong =0x10000
  3828. >>(0x0118-0x0FF60)    ulelong&0x80000007  0x80000007 \b, all regions
  3829. >>(0x0118-0x0FF60)    ulelong&0x80000007  !0x80000007
  3830. >>>(0x0118-0x0FF60)   ulelong >0           (regions:
  3831. >>>>(0x0118-0x0FF60)  ulelong &0x00000001  NA
  3832. >>>>(0x0118-0x0FF60)  ulelong &0x00000002  Japan
  3833. >>>>(0x0118-0x0FF60)  ulelong &0x00000004  Rest_of_World
  3834. >>>>(0x0118-0x0FF60)  ulelong &0x80000000  Manufacturer
  3835. >>>(0x0118-0x0FF60)   ulelong >0           \b)
  3836.  
  3837. # --------------------------------
  3838. # Microsoft Xbox data file formats
  3839. 0       string          XIP0            XIP, Microsoft Xbox data
  3840. 0       string          XTF0            XTF, Microsoft Xbox data
  3841.  
  3842. # Atari Lynx cartridge dump (EXE/BLL header)
  3843. # From: "Stefan A. Haubenthal" <polluks@web.de>
  3844.  
  3845. 0    beshort        0x8008        Lynx cartridge,
  3846. >2    beshort        x        RAM start $%04x
  3847. >6    string        BS93
  3848.  
  3849. # Opera file system that is used on the 3DO console
  3850. # From: Serge van den Boom <svdb@stack.nl>
  3851. 0    string        \x01ZZZZZ\x01    3DO "Opera" file system
  3852.  
  3853. # From Gürkan Sengün <gurkan@linuks.mine.nu>, www.linuks.mine.nu
  3854. 0    string        GBS        Nintendo Gameboy Music/Audio Data
  3855. 12    string        GameBoy\ Music\ Module    Nintendo Gameboy Music Module
  3856.  
  3857. # Playstations Patch Files from: From: Thomas Klausner <tk@giga.or.at>
  3858. 0    string    PPF30            Playstation Patch File version 3.0
  3859. >5    byte    0            \b, PPF 1.0 patch
  3860. >5    byte    1            \b, PPF 2.0 patch
  3861. >5    byte    2            \b, PPF 3.0 patch
  3862. >>56    byte    0            \b, Imagetype BIN (any)
  3863. >>56    byte    1            \b, Imagetype GI (PrimoDVD)
  3864. >>57    byte    0            \b, Blockcheck disabled
  3865. >>57    byte    1            \b, Blockcheck enabled
  3866. >>58    byte    0            \b, Undo data not available
  3867. >>58    byte    1            \b, Undo data available
  3868. >6    string    x            \b, description: %s
  3869.  
  3870. 0    string    PPF20            Playstation Patch File version 2.0
  3871. >5    byte    0            \b, PPF 1.0 patch
  3872. >5    byte    1            \b, PPF 2.0 patch
  3873. >>56    lelong    >0            \b, size of file to patch %d
  3874. >6    string    x            \b, description: %s
  3875.  
  3876. 0    string    PPF10            Playstation Patch File version 1.0
  3877. >5    byte    0            \b, Simple Encoding
  3878. >6    string    x            \b, description: %s
  3879.  
  3880. # From: Daniel Dawson <ddawson@icehouse.net>
  3881. # SNES9x .smv "movie" file format.
  3882. 0        string        SMV\x1A    SNES9x input recording
  3883. >0x4        lelong        x    \b, version %d
  3884. # version 4 is latest so far 
  3885. >0x4        lelong        <5
  3886. >>0x8        ledate        x    \b, recorded at %s
  3887. >>0xc        lelong        >0    \b, rerecorded %d times
  3888. >>0x10        lelong        x    \b, %d frames long
  3889. >>0x14        byte        >0    \b, data for controller(s):
  3890. >>>0x14        byte        &0x1    #1
  3891. >>>0x14        byte        &0x2    #2
  3892. >>>0x14        byte        &0x4    #3
  3893. >>>0x14        byte        &0x8    #4
  3894. >>>0x14        byte        &0x10    #5
  3895. >>0x15        byte        ^0x1    \b, begins from snapshot
  3896. >>0x15        byte        &0x1    \b, begins from reset
  3897. >>0x15        byte        ^0x2    \b, NTSC standard
  3898. >>0x15        byte        &0x2    \b, PAL standard
  3899. >>0x17        byte        &0x1    \b, settings:
  3900. # WIP1Timing not used as of version 4
  3901. >>>0x4        lelong        <4
  3902. >>>>0x17    byte        &0x2    WIP1Timing
  3903. >>>0x17        byte        &0x4    Left+Right
  3904. >>>0x17        byte        &0x8    VolumeEnvX
  3905. >>>0x17        byte        &0x10    FakeMute
  3906. >>>0x17        byte        &0x20    SyncSound
  3907. # New flag as of version 4
  3908. >>>0x4        lelong        >3
  3909. >>>>0x17    byte        &0x80    NoCPUShutdown
  3910. >>0x4        lelong        <4
  3911. >>>0x18        lelong        >0x23
  3912. >>>>0x20    leshort        !0
  3913. >>>>>0x20    lestring16    x    \b, metadata: "%s"
  3914. >>0x4        lelong        >3
  3915. >>>0x24        byte        >0    \b, port 1:
  3916. >>>>0x24    byte        1    joypad
  3917. >>>>0x24    byte        2    mouse
  3918. >>>>0x24    byte        3    SuperScope
  3919. >>>>0x24    byte        4    Justifier
  3920. >>>>0x24    byte        5    multitap
  3921. >>>0x24        byte        >0    \b, port 2:
  3922. >>>>0x25    byte        1    joypad
  3923. >>>>0x25    byte        2    mouse
  3924. >>>>0x25    byte        3    SuperScope
  3925. >>>>0x25    byte        4    Justifier
  3926. >>>>0x25    byte        5    multitap
  3927. >>>0x18        lelong        >0x43
  3928. >>>>0x40    leshort        !0
  3929. >>>>>0x40    lestring16    x    \b, metadata: "%s"
  3930. >>0x17        byte        &0x40   \b, ROM:
  3931. >>>(0x18.l-26)    lelong        x    CRC32 0x%08x
  3932. >>>(0x18.l-23)    string        x    "%s"
  3933.  
  3934. # Type: scummVM savegame files
  3935. # From: Sven Hartge <debian@ds9.argh.org>
  3936. 0    string    SCVM    ScummVM savegame
  3937. >12    string    >\0    "%s"
  3938. #------------------------------------------------------------------------------
  3939. # convex:  file(1) magic for Convex boxes
  3940. #
  3941. # Convexes are big-endian.
  3942. #
  3943. # /*\
  3944. #  * Below are the magic numbers and tests added for Convex.
  3945. #  * Added at beginning, because they are expected to be used most.
  3946. # \*/
  3947. 0    belong    0507    Convex old-style object
  3948. >16    belong    >0    not stripped
  3949. 0    belong    0513    Convex old-style demand paged executable
  3950. >16    belong    >0    not stripped
  3951. 0    belong    0515    Convex old-style pre-paged executable
  3952. >16    belong    >0    not stripped
  3953. 0    belong    0517    Convex old-style pre-paged, non-swapped executable
  3954. >16    belong    >0    not stripped
  3955. 0    belong    0x011257    Core file
  3956. #
  3957. # The following are a series of dump format magic numbers.  Each one
  3958. # corresponds to a drastically different dump format.  The first on is
  3959. # the original dump format on a 4.1 BSD or earlier file system.  The
  3960. # second marks the change between the 4.1 file system and the 4.2 file
  3961. # system.  The Third marks the changing of the block size from 1K
  3962. # to 2K to be compatible with an IDC file system.  The fourth indicates
  3963. # a dump that is dependent on Convex Storage Manager, because data in
  3964. # secondary storage is not physically contained within the dump.
  3965. # The restore program uses these number to determine how the data is
  3966. # to be extracted.
  3967. #
  3968. 24    belong    =60011    dump format, 4.1 BSD or earlier
  3969. 24    belong    =60012    dump format, 4.2 or 4.3 BSD without IDC
  3970. 24    belong    =60013    dump format, 4.2 or 4.3 BSD (IDC compatible)
  3971. 24    belong    =60014    dump format, Convex Storage Manager by-reference dump
  3972. #
  3973. # what follows is a bunch of bit-mask checks on the flags field of the opthdr.
  3974. # If there is no `=' sign, assume just checking for whether the bit is set?
  3975. #
  3976. 0    belong    0601        Convex SOFF
  3977. >88    belong&0x000f0000    =0x00000000    c1
  3978. >88    belong            &0x00010000    c2
  3979. >88    belong            &0x00020000    c2mp
  3980. >88    belong            &0x00040000    parallel
  3981. >88    belong            &0x00080000    intrinsic
  3982. >88    belong            &0x00000001    demand paged
  3983. >88    belong            &0x00000002    pre-paged
  3984. >88    belong            &0x00000004    non-swapped
  3985. >88    belong            &0x00000008    POSIX
  3986. #
  3987. >84    belong            &0x80000000    executable
  3988. >84    belong            &0x40000000    object
  3989. >84    belong&0x20000000    =0        not stripped
  3990. >84    belong&0x18000000    =0x00000000    native fpmode
  3991. >84    belong&0x18000000    =0x10000000    ieee fpmode
  3992. >84    belong&0x18000000    =0x18000000    undefined fpmode
  3993. #
  3994. 0    belong            0605        Convex SOFF core
  3995. #
  3996. 0    belong            0607        Convex SOFF checkpoint
  3997. >88    belong&0x000f0000    =0x00000000    c1
  3998. >88    belong            &0x00010000    c2
  3999. >88    belong            &0x00020000    c2mp
  4000. >88    belong            &0x00040000    parallel
  4001. >88    belong            &0x00080000    intrinsic
  4002. >88    belong            &0x00000008    POSIX
  4003. #
  4004. >84    belong&0x18000000    =0x00000000    native fpmode
  4005. >84    belong&0x18000000    =0x10000000    ieee fpmode
  4006. >84    belong&0x18000000    =0x18000000    undefined fpmode
  4007.  
  4008. #------------------------------------------------------------------------------
  4009. # cracklib:  file (1) magic for cracklib v2.7
  4010.  
  4011. 0    lelong    0x70775631    Cracklib password index, little endian
  4012. >4    long    >0        (%i words)
  4013. >4    long    0        ("64-bit")
  4014. >>8    long    >-1        (%i words)
  4015. 0    belong    0x70775631    Cracklib password index, big endian
  4016. >4    belong    >-1        (%i words)
  4017. # really bellong 0x0000000070775631
  4018. 0    search/1    \0\0\0\0pwV1    Cracklib password index, big endian ("64-bit")
  4019. >12    belong    >0        (%i words)
  4020. # ----------------------------------------------------------------------------
  4021. # ctags:  file (1) magic for Exuberant Ctags files
  4022. # From: Alexander Mai <mai@migdal.ikp.physik.tu-darmstadt.de>
  4023. 0    search/1    =!_TAG    Exuberant Ctags tag file text
  4024.  
  4025. #------------------------------------------------------------------------------
  4026. # dact:  file(1) magic for DACT compressed files
  4027. #
  4028. 0    long        0x444354C3    DACT compressed data
  4029. >4    byte        >-1        (version %i.
  4030. >5    byte        >-1        $BS%i.
  4031. >6    byte        >-1        $BS%i)
  4032. >7    long        >0        $BS, original size: %i bytes
  4033. >15    long        >30        $BS, block size: %i bytes
  4034.  
  4035. #------------------------------------------------------------------------------
  4036. # database:  file(1) magic for various databases
  4037. #
  4038. # extracted from header/code files by Graeme Wilford (eep2gw@ee.surrey.ac.uk)
  4039. #
  4040. #
  4041. # GDBM magic numbers
  4042. #  Will be maintained as part of the GDBM distribution in the future.
  4043. #  <downsj@teeny.org>
  4044. 0    belong    0x13579ace    GNU dbm 1.x or ndbm database, big endian
  4045. !:mime    application/x-gdbm
  4046. 0    lelong    0x13579ace    GNU dbm 1.x or ndbm database, little endian
  4047. !:mime    application/x-gdbm
  4048. 0    string    GDBM        GNU dbm 2.x database
  4049. !:mime    application/x-gdbm
  4050. #
  4051. # Berkeley DB
  4052. #
  4053. # Ian Darwin's file /etc/magic files: big/little-endian version.
  4054. #
  4055. # Hash 1.85/1.86 databases store metadata in network byte order.
  4056. # Btree 1.85/1.86 databases store the metadata in host byte order.
  4057. # Hash and Btree 2.X and later databases store the metadata in host byte order.
  4058.  
  4059. 0    long    0x00061561    Berkeley DB
  4060. !:mime    application/x-dbm
  4061. >8    belong    4321
  4062. >>4    belong    >2        1.86
  4063. >>4    belong    <3        1.85
  4064. >>4    belong    >0        (Hash, version %d, native byte-order)
  4065. >8    belong    1234
  4066. >>4    belong    >2        1.86
  4067. >>4    belong    <3        1.85
  4068. >>4    belong    >0        (Hash, version %d, little-endian)
  4069.  
  4070. 0    belong    0x00061561    Berkeley DB
  4071. >8    belong    4321
  4072. >>4    belong    >2        1.86
  4073. >>4    belong    <3        1.85
  4074. >>4    belong    >0        (Hash, version %d, big-endian)
  4075. >8    belong    1234
  4076. >>4    belong    >2        1.86
  4077. >>4    belong    <3        1.85
  4078. >>4    belong    >0        (Hash, version %d, native byte-order)
  4079.  
  4080. 0    long    0x00053162    Berkeley DB 1.85/1.86
  4081. >4    long    >0        (Btree, version %d, native byte-order)
  4082. 0    belong    0x00053162    Berkeley DB 1.85/1.86
  4083. >4    belong    >0        (Btree, version %d, big-endian)
  4084. 0    lelong    0x00053162    Berkeley DB 1.85/1.86
  4085. >4    lelong    >0        (Btree, version %d, little-endian)
  4086.  
  4087. 12    long    0x00061561    Berkeley DB
  4088. >16    long    >0        (Hash, version %d, native byte-order)
  4089. 12    belong    0x00061561    Berkeley DB
  4090. >16    belong    >0        (Hash, version %d, big-endian)
  4091. 12    lelong    0x00061561    Berkeley DB
  4092. >16    lelong    >0        (Hash, version %d, little-endian)
  4093.  
  4094. 12    long    0x00053162    Berkeley DB
  4095. >16    long    >0        (Btree, version %d, native byte-order)
  4096. 12    belong    0x00053162    Berkeley DB
  4097. >16    belong    >0        (Btree, version %d, big-endian)
  4098. 12    lelong    0x00053162    Berkeley DB
  4099. >16    lelong    >0        (Btree, version %d, little-endian)
  4100.  
  4101. 12    long    0x00042253    Berkeley DB
  4102. >16    long    >0        (Queue, version %d, native byte-order)
  4103. 12    belong    0x00042253    Berkeley DB
  4104. >16    belong    >0        (Queue, version %d, big-endian)
  4105. 12    lelong    0x00042253    Berkeley DB
  4106. >16    lelong    >0        (Queue, version %d, little-endian)
  4107.  
  4108. # From Max Bowsher.
  4109. 12    long    0x00040988    Berkeley DB
  4110. >16    long    >0        (Log, version %d, native byte-order)
  4111. 12    belong    0x00040988    Berkeley DB 
  4112. >16    belong    >0        (Log, version %d, big-endian)
  4113. 12    lelong    0x00040988    Berkeley DB
  4114. >16    lelong    >0        (Log, version %d, little-endian)
  4115.  
  4116. #
  4117. #
  4118. # Round Robin Database Tool by Tobias Oetiker <oetiker@ee.ethz.ch>
  4119. 0    string    RRD        RRDTool DB
  4120. >4    string    x        version %s
  4121. #----------------------------------------------------------------------
  4122. # ROOT: file(1) magic for ROOT databases
  4123. #
  4124. 0       string  root\0  ROOT file
  4125. >4      belong  x       Version %d
  4126. >33     belong  x       (Compression: %d)
  4127.  
  4128. # XXX: Weak magic.
  4129. # Alex Ott <ott@jet.msk.su>
  4130. ## Paradox file formats
  4131. #2      leshort    0x0800    Paradox 
  4132. #>0x39      byte        3    v. 3.0 
  4133. #>0x39      byte        4    v. 3.5 
  4134. #>0x39      byte        9    v. 4.x 
  4135. #>0x39      byte        10    v. 5.x 
  4136. #>0x39      byte        11    v. 5.x 
  4137. #>0x39      byte        12    v. 7.x 
  4138. #>>0x04      byte        0    indexed .DB data file 
  4139. #>>0x04      byte        1    primary index .PX file 
  4140. #>>0x04      byte        2    non-indexed .DB data file 
  4141. #>>0x04      byte        3    non-incrementing secondary index .Xnn file 
  4142. #>>0x04      byte        4    secondary index .Ynn file 
  4143. #>>0x04      byte        5    incrementing secondary index .Xnn file 
  4144. #>>0x04      byte        6    non-incrementing secondary index .XGn file 
  4145. #>>0x04      byte        7    secondary index .YGn file 
  4146. #>>>0x04      byte        8    incrementing secondary index .XGn file 
  4147.  
  4148. ## XBase database files
  4149. #0      byte       0x02    
  4150. #>8     leshort      >0
  4151. #>>12   leshort    0    FoxBase 
  4152. #!:mime    application/x-dbf
  4153. #>>>0x04    lelong        0        (no records)
  4154. #>>>0x04    lelong        >0        (%ld records)
  4155. #
  4156. #0      byte       0x03    
  4157. #!:mime    application/x-dbf
  4158. #>8     leshort      >0
  4159. #>>12   leshort    0    FoxBase+, FoxPro, dBaseIII+, dBaseIV, no memo 
  4160. #>>>0x04    lelong        0        (no records)
  4161. #>>>0x04    lelong        >0        (%ld records)
  4162. #
  4163. #0      byte       0x04    
  4164. #!:mime    application/x-dbf
  4165. #>8     leshort      >0
  4166. #>>12   leshort    0    dBASE IV no memo file 
  4167. #>>>0x04    lelong        0        (no records)
  4168. #>>>0x04    lelong        >0        (%ld records)
  4169. #
  4170. #0      byte       0x05    
  4171. #!:mime    application/x-dbf
  4172. #>8     leshort      >0
  4173. #>>12   leshort    0    dBASE V no memo file 
  4174. #>>>0x04    lelong        0        (no records)
  4175. #>>>0x04    lelong        >0        (%ld records)
  4176. #
  4177. #0      byte       0x30
  4178. #!:mime    application/x-dbf
  4179. #>8     leshort      >0
  4180. #>>12   leshort    0    Visual FoxPro 
  4181. #>>>0x04    lelong        0        (no records)
  4182. #>>>0x04    lelong        >0        (%ld records)
  4183. #
  4184. #0      byte       0x43
  4185. #!:mime    application/x-dbf
  4186. #>8     leshort      >0
  4187. #>>12   leshort    0    FlagShip with memo var size 
  4188. #>>>0x04    lelong        0        (no records)
  4189. #>>>0x04    lelong        >0        (%ld records)
  4190. #
  4191. #0      byte       0x7b
  4192. #!:mime    application/x-dbf
  4193. #>8     leshort      >0
  4194. #>>12   leshort    0    dBASEIV with memo 
  4195. #>>>0x04    lelong        0        (no records)
  4196. #>>>0x04    lelong        >0        (%ld records)
  4197. #
  4198. #0      byte       0x83    
  4199. #!:mime    application/x-dbf
  4200. #>8     leshort      >0
  4201. #>>12   leshort    0    FoxBase+, dBaseIII+ with memo 
  4202. #>>>0x04    lelong        0        (no records)
  4203. #>>>0x04    lelong        >0        (%ld records)
  4204. #
  4205. #0      byte       0x8b
  4206. #!:mime    application/x-dbf
  4207. #>8     leshort      >0
  4208. #>>12   leshort    0    dBaseIV with memo 
  4209. #>>>0x04    lelong        0        (no records)
  4210. #>>>0x04    lelong        >0        (%ld records)
  4211. #
  4212. #0      byte       0x8e    
  4213. #!:mime    application/x-dbf
  4214. #>8     leshort      >0
  4215. #>>12   leshort    0    dBaseIV with SQL Table 
  4216. #>>>0x04    lelong        0        (no records)
  4217. #>>>0x04    lelong        >0        (%ld records)
  4218. #
  4219. #0      byte       0xb3
  4220. #!:mime    application/x-dbf
  4221. #>8     leshort      >0
  4222. #>>12   leshort    0    FlagShip with .dbt memo 
  4223. #>>>0x04    lelong        0        (no records)
  4224. #>>>0x04    lelong        >0        (%ld records)
  4225. #
  4226. #0      byte       0xf5
  4227. #!:mime    application/x-dbf
  4228. #>8     leshort      >0
  4229. #>>12   leshort    0    FoxPro with memo 
  4230. #>>>0x04    lelong        0        (no records)
  4231. #>>>0x04    lelong        >0        (%ld records)
  4232. #
  4233. #0    leshort        0x0006        DBase 3 index file
  4234.  
  4235. # MS Access database
  4236. 4    string    Standard\ Jet\ DB    Microsoft Access Database
  4237. !:mime    application/x-msaccess
  4238.  
  4239. # TDB database from Samba et al - Martin Pool <mbp@samba.org>
  4240. 0    string    TDB\ file        TDB database
  4241. >32    lelong    0x2601196D        version 6, little-endian
  4242. >>36    lelong    x            hash size %d bytes
  4243.  
  4244. # SE Linux policy database
  4245. 0       lelong  0xf97cff8c      SE Linux policy
  4246. >16     lelong  x               v%d
  4247. >20     lelong  1      MLS
  4248. >24     lelong  x       %d symbols
  4249. >28     lelong  x       %d ocons
  4250.  
  4251. # ICE authority file data (Wolfram Kleff)
  4252. 2    string        ICE        ICE authority data
  4253.  
  4254. # X11 Xauthority file (Wolfram Kleff)
  4255. 10    string        MIT-MAGIC-COOKIE-1    X11 Xauthority data
  4256. 11    string        MIT-MAGIC-COOKIE-1    X11 Xauthority data
  4257. 12    string        MIT-MAGIC-COOKIE-1    X11 Xauthority data
  4258. 13    string        MIT-MAGIC-COOKIE-1    X11 Xauthority data
  4259. 14    string        MIT-MAGIC-COOKIE-1    X11 Xauthority data
  4260. 15    string        MIT-MAGIC-COOKIE-1    X11 Xauthority data
  4261. 16    string        MIT-MAGIC-COOKIE-1    X11 Xauthority data
  4262. 17    string        MIT-MAGIC-COOKIE-1    X11 Xauthority data
  4263. 18    string        MIT-MAGIC-COOKIE-1    X11 Xauthority data
  4264.  
  4265. # From: Maxime Henrion <mux@FreeBSD.org>
  4266. # PostgreSQL's custom dump format, Maxime Henrion <mux@FreeBSD.org>
  4267. 0    string        PGDMP        PostgreSQL custom database dump
  4268. >5    byte        x        - v%d
  4269. >6    byte        x        \b.%d
  4270. >5    beshort        <0x101        \b-0
  4271. >5    beshort        >0x100
  4272. >>7    byte        x        \b-%d
  4273.  
  4274. # Type: Advanced Data Format (ADF) database
  4275. # URL:  http://www.grc.nasa.gov/WWW/cgns/adf/
  4276. # From: Nicolas Chauvat <nicolas.chauvat@logilab.fr>
  4277. 0    string    @(#)ADF\ Database    CGNS Advanced Data Format
  4278.  
  4279. # Type:    QDBM Quick Database Manager
  4280. # From:    Benoit Sibaud <bsibaud@april.org>
  4281. 0    string    \\[depot\\]\n\f        Quick Database Manager, little endian
  4282. 0    string    \\[DEPOT\\]\n\f        Quick Database Manager, big endian
  4283.  
  4284. # Type:    TokyoCabinet database
  4285. # URL:    http://tokyocabinet.sourceforge.net/
  4286. # From:    Benoit Sibaud <bsibaud@april.org>
  4287. 0    string    ToKyO\ CaBiNeT\n    TokyoCabinet database
  4288. >14    string    x            (version %s)
  4289.  
  4290. #------------------------------------------------------------------------------
  4291. # diamond:  file(1) magic for Diamond system
  4292. #
  4293. # ... diamond is a multi-media mail and electronic conferencing system....
  4294. #
  4295. # XXX - I think it was either renamed Slate, or replaced by Slate....
  4296. #
  4297. #    The full deal is too long...
  4298. #0    string    <list>\n<protocol\ bbn-multimedia-format>    Diamond Multimedia Document
  4299. 0    string    =<list>\n<protocol\ bbn-m    Diamond Multimedia Document
  4300. #------------------------------------------------------------------------------
  4301. # diff:  file(1) magic for diff(1) output
  4302. #
  4303. 0    search/1    diff\         diff output text
  4304. !:mime    text/x-diff
  4305. 0    search/1    ***\         diff output text
  4306. !:mime    text/x-diff
  4307. 0    search/1    Only\ in\     diff output text
  4308. !:mime    text/x-diff
  4309. 0    search/1    Common\ subdirectories:\     diff output text
  4310. !:mime    text/x-diff
  4311.  
  4312. 0    search/1    Index:        RCS/CVS diff output text
  4313. !:mime    text/x-diff
  4314. #  Digital UNIX - Info
  4315. #
  4316. 0    string    =!<arch>\n________64E    Alpha archive
  4317. >22    string    X            -- out of date
  4318. #
  4319. # Alpha COFF Based Executables
  4320. # The stripped stuff really needs to be an 8 byte (64 bit) compare,
  4321. # but this works
  4322. 0    leshort        0x183        COFF format alpha
  4323. >22    leshort&020000    &010000        sharable library,
  4324. >22    leshort&020000    ^010000        dynamically linked,
  4325. >24    leshort        0410        pure
  4326. >24    leshort        0413        demand paged
  4327. >8    lelong        >0        executable or object module, not stripped
  4328. >8    lelong        0
  4329. >>12    lelong        0        executable or object module, stripped
  4330. >>12    lelong        >0        executable or object module, not stripped
  4331. >27     byte            >0              - version %d.
  4332. >26     byte            >0              %d-
  4333. >28     leshort         >0              %d
  4334. #
  4335. # The next is incomplete, we could tell more about this format,
  4336. # but its not worth it.
  4337. 0    leshort        0x188    Alpha compressed COFF
  4338. 0    leshort        0x18f    Alpha u-code object
  4339. #
  4340. #
  4341. # Some other interesting Digital formats,
  4342. 0    string    \377\377\177        ddis/ddif
  4343. 0    string    \377\377\174        ddis/dots archive
  4344. 0    string    \377\377\176        ddis/dtif table data
  4345. 0    string    \033c\033        LN03 output
  4346. 0    long    04553207        X image
  4347. #
  4348. 0    string    =!<PDF>!\n        profiling data file
  4349. #
  4350. # Locale data tables (MIPS and Alpha).
  4351. #
  4352. 0    short        0x0501        locale data table
  4353. >6    short        0x24        for MIPS
  4354. >6    short        0x40        for Alpha
  4355. # ATSC A/53 aka AC-3 aka Dolby Digital <ashitaka@gmx.at>
  4356. # from http://www.atsc.org/standards/a_52a.pdf
  4357. # corrections, additions, etc. are always welcome!
  4358. #
  4359. # syncword
  4360. 0       beshort         0x0b77  ATSC A/52 aka AC-3 aka Dolby Digital stream,
  4361. # fscod
  4362. >4      byte&0xc0       0x00    48 kHz,
  4363. >4      byte&0xc0       0x40    44.1 kHz,
  4364. >4      byte&0xc0       0x80    32 kHz,
  4365. # is this one used for 96 kHz?
  4366. >4      byte&0xc0       0xc0    reserved frequency,
  4367. #
  4368. >5    byte&7 = 0        \b, complete main (CM)
  4369. >5    byte&7 = 1        \b, music and effects (ME)
  4370. >5    byte&7 = 2        \b, visually impaired (VI)
  4371. >5    byte&7 = 3        \b, hearing impaired (HI)
  4372. >5    byte&7 = 4        \b, dialogue (D)
  4373. >5    byte&7 = 5        \b, commentary (C)
  4374. >5    byte&7 = 6        \b, emergency (E)
  4375. # acmod
  4376. >6      byte&0xe0       0x00    1+1 front,
  4377. >6      byte&0xe0       0x20    1 front/0 rear,
  4378. >6      byte&0xe0       0x40    2 front/0 rear,
  4379. >6      byte&0xe0       0x60    3 front/0 rear,
  4380. >6      byte&0xe0       0x80    2 front/1 rear,
  4381. >6      byte&0xe0       0xa0    3 front/1 rear,
  4382. >6      byte&0xe0       0xc0    2 front/2 rear,
  4383. >6      byte&0xe0       0xe0    3 front/2 rear,
  4384. # lfeon (these may be incorrect)
  4385. >7      byte&0x40       0x00    LFE off,
  4386. >7      byte&0x40       0x40    LFE on,
  4387. #
  4388. >4    byte&0x3e = 0x00    \b, 32 kbit/s
  4389. >4    byte&0x3e = 0x02        \b, 40 kbit/s
  4390. >4    byte&0x3e = 0x04        \b, 48 kbit/s
  4391. >4    byte&0x3e = 0x06        \b, 56 kbit/s
  4392. >4    byte&0x3e = 0x08        \b, 64 kbit/s
  4393. >4    byte&0x3e = 0x0a        \b, 80 kbit/s
  4394. >4    byte&0x3e = 0x0c        \b, 96 kbit/s
  4395. >4    byte&0x3e = 0x0e        \b, 112 kbit/s
  4396. >4    byte&0x3e = 0x10        \b, 128 kbit/s
  4397. >4    byte&0x3e = 0x12        \b, 160 kbit/s
  4398. >4    byte&0x3e = 0x14        \b, 192 kbit/s
  4399. >4    byte&0x3e = 0x16        \b, 224 kbit/s
  4400. >4    byte&0x3e = 0x18        \b, 256 kbit/s
  4401. >4    byte&0x3e = 0x1a        \b, 320 kbit/s
  4402. >4    byte&0x3e = 0x1c        \b, 384 kbit/s
  4403. >4    byte&0x3e = 0x1e        \b, 448 kbit/s
  4404. >4    byte&0x3e = 0x20        \b, 512 kbit/s
  4405. >4    byte&0x3e = 0x22        \b, 576 kbit/s
  4406. >4    byte&0x3e = 0x24        \b, 640 kbit/s
  4407. # dsurmod (these may be incorrect)
  4408. >6      beshort&0x0180  0x0000  Dolby Surround not indicated
  4409. >6      beshort&0x0180  0x0080  not Dolby Surround encoded
  4410. >6      beshort&0x0180  0x0100  Dolby Surround encoded
  4411. >6      beshort&0x0180  0x0180  reserved Dolby Surround mode
  4412.  
  4413. #------------------------------------------------------------------------------
  4414. # dump:  file(1) magic for dump file format--for new and old dump filesystems
  4415. #
  4416. # We specify both byte orders in order to recognize byte-swapped dumps.
  4417. #
  4418. 24    belong    60012        new-fs dump file (big endian),
  4419. >4    bedate    x        Previous dump %s,
  4420. >8    bedate    x        This dump %s,
  4421. >12    belong    >0        Volume %ld,
  4422. >692    belong    0        Level zero, type:
  4423. >692    belong    >0        Level %d, type:
  4424. >0    belong    1        tape header,
  4425. >0    belong    2        beginning of file record,
  4426. >0    belong    3        map of inodes on tape,
  4427. >0    belong    4        continuation of file record,
  4428. >0    belong    5        end of volume,
  4429. >0    belong    6        map of inodes deleted,
  4430. >0    belong    7        end of medium (for floppy),
  4431. >676    string    >\0        Label %s,
  4432. >696    string    >\0        Filesystem %s,
  4433. >760    string    >\0        Device %s,
  4434. >824    string    >\0        Host %s,
  4435. >888    belong    >0        Flags %x
  4436.  
  4437. 24    belong    60011        old-fs dump file (big endian),
  4438. #>4    bedate    x        Previous dump %s,
  4439. #>8    bedate    x        This dump %s,
  4440. >12    belong    >0        Volume %ld,
  4441. >692    belong    0        Level zero, type:
  4442. >692    belong    >0        Level %d, type:
  4443. >0    belong    1        tape header,
  4444. >0    belong    2        beginning of file record,
  4445. >0    belong    3        map of inodes on tape,
  4446. >0    belong    4        continuation of file record,
  4447. >0    belong    5        end of volume,
  4448. >0    belong    6        map of inodes deleted,
  4449. >0    belong    7        end of medium (for floppy),
  4450. >676    string    >\0        Label %s,
  4451. >696    string    >\0        Filesystem %s,
  4452. >760    string    >\0        Device %s,
  4453. >824    string    >\0        Host %s,
  4454. >888    belong    >0        Flags %x
  4455.  
  4456. 24    lelong    60012        new-fs dump file (little endian),
  4457. >4    ledate    x        This dump %s,
  4458. >8    ledate    x        Previous dump %s,
  4459. >12    lelong    >0        Volume %ld,
  4460. >692    lelong    0        Level zero, type:
  4461. >692    lelong    >0        Level %d, type:
  4462. >0    lelong    1        tape header,
  4463. >0    lelong    2        beginning of file record,
  4464. >0    lelong    3        map of inodes on tape,
  4465. >0    lelong    4        continuation of file record,
  4466. >0    lelong    5        end of volume,
  4467. >0    lelong    6        map of inodes deleted,
  4468. >0    lelong    7        end of medium (for floppy),
  4469. >676    string    >\0        Label %s,
  4470. >696    string    >\0        Filesystem %s,
  4471. >760    string    >\0        Device %s,
  4472. >824    string    >\0        Host %s,
  4473. >888    lelong    >0        Flags %x
  4474.  
  4475. 24    lelong    60011        old-fs dump file (little endian),
  4476. #>4    ledate    x        Previous dump %s,
  4477. #>8    ledate    x        This dump %s,
  4478. >12    lelong    >0        Volume %ld,
  4479. >692    lelong    0        Level zero, type:
  4480. >692    lelong    >0        Level %d, type:
  4481. >0    lelong    1        tape header,
  4482. >0    lelong    2        beginning of file record,
  4483. >0    lelong    3        map of inodes on tape,
  4484. >0    lelong    4        continuation of file record,
  4485. >0    lelong    5        end of volume,
  4486. >0    lelong    6        map of inodes deleted,
  4487. >0    lelong    7        end of medium (for floppy),
  4488. >676    string    >\0        Label %s,
  4489. >696    string    >\0        Filesystem %s,
  4490. >760    string    >\0        Device %s,
  4491. >824    string    >\0        Host %s,
  4492. >888    lelong    >0        Flags %x
  4493.  
  4494. 18    leshort    60011        old-fs dump file (16-bit, assuming PDP-11 endianness),
  4495. >2    medate    x        Previous dump %s,
  4496. >6    medate    x        This dump %s,
  4497. >10    leshort    >0        Volume %ld,
  4498. >0    leshort    1        tape header.
  4499. >0    leshort    2        beginning of file record.
  4500. >0    leshort    3        map of inodes on tape.
  4501. >0    leshort    4        continuation of file record.
  4502. >0    leshort    5        end of volume.
  4503. >0    leshort    6        map of inodes deleted.
  4504. >0    leshort    7        end of medium (for floppy).
  4505.  
  4506. 24    belong    0x19540119    new-fs dump file (ufs2, big endian),
  4507. >896    beqdate    x        Previous dump %s,
  4508. >904    beqdate    x        This dump %s,
  4509. >12    belong    >0        Volume %ld,
  4510. >692    belong    0        Level zero, type:
  4511. >692    belong    >0        Level %d, type:
  4512. >0    belong    1        tape header,
  4513. >0    belong    2        beginning of file record,
  4514. >0    belong    3        map of inodes on tape,
  4515. >0    belong    4        continuation of file record,
  4516. >0    belong    5        end of volume,
  4517. >0    belong    6        map of inodes deleted,
  4518. >0    belong    7        end of medium (for floppy),
  4519. >676    string    >\0        Label %s,
  4520. >696    string    >\0        Filesystem %s,
  4521. >760    string    >\0        Device %s,
  4522. >824    string    >\0        Host %s,
  4523. >888    belong    >0        Flags %x
  4524.  
  4525. 24    lelong    0x19540119    new-fs dump file (ufs2, little endian),
  4526. >896    leqdate    x        This dump %s,
  4527. >904    leqdate    x        Previous dump %s,
  4528. >12    lelong    >0        Volume %ld,
  4529. >692    lelong    0        Level zero, type:
  4530. >692    lelong    >0        Level %d, type:
  4531. >0    lelong    1        tape header,
  4532. >0    lelong    2        beginning of file record,
  4533. >0    lelong    3        map of inodes on tape,
  4534. >0    lelong    4        continuation of file record,
  4535. >0    lelong    5        end of volume,
  4536. >0    lelong    6        map of inodes deleted,
  4537. >0    lelong    7        end of medium (for floppy),
  4538. >676    string    >\0        Label %s,
  4539. >696    string    >\0        Filesystem %s,
  4540. >760    string    >\0        Device %s,
  4541. >824    string    >\0        Host %s,
  4542. >888    lelong    >0        Flags %x
  4543.  
  4544. #------------------------------------------------------------------------------
  4545. # Dyadic: file(1) magic for Dyalog APL.
  4546. #
  4547. 0     byte    0xaa
  4548. >1    byte    <4        Dyalog APL
  4549. >>1    byte    0x00        incomplete workspace
  4550. >>1    byte    0x01        component file
  4551. >>1    byte    0x02        external variable
  4552. >>1    byte    0x03        workspace
  4553. >>2    byte    x        version %d
  4554. >>3    byte    x        .%d
  4555.  
  4556. #------------------------------------------------------------------------------
  4557. # T602 editor documents 
  4558. # by David Necas <yeti@physics.muni.cz>
  4559. 0    string    @CT\     T602 document data,
  4560. >4    string    0    Kamenicky
  4561. >4    string    1    CP 852
  4562. >4    string    2    KOI8-CS
  4563. >4    string    >2    unknown encoding
  4564.  
  4565. # Vi IMproved Encrypted file 
  4566. # by David Necas <yeti@physics.muni.cz>
  4567. 0    string    VimCrypt~    Vim encrypted file data
  4568. # Vi IMproved Swap file
  4569. # by Sven Wegener <swegener@gentoo.org>
  4570. 0    string    b0VIM\         Vim swap file
  4571. >&0    string    >\0        \b, version %s
  4572.  
  4573. #------------------------------------------------------------------------------
  4574. # efi:  file(1) magic for Universal EFI binaries
  4575.  
  4576. 0    lelong    0x0ef1fab9
  4577. >4    lelong    1        Universal EFI binary with 1 architecture
  4578. >>&0    lelong    7        \b, i386
  4579. >>&0    lelong    0x01000007    \b, x86_64
  4580. >4    lelong    2        Universal EFI binary with 2 architectures
  4581. >>&0    lelong    7        \b, i386
  4582. >>&0    lelong    0x01000007    \b, x86_64
  4583. >>&20    lelong    7        \b, i386
  4584. >>&20    lelong    0x01000007    \b, x86_64
  4585. >4    lelong    >2        Universal EFI binary with %ld architectures
  4586.  
  4587. #------------------------------------------------------------------------------
  4588. # elf:  file(1) magic for ELF executables
  4589. #
  4590. # We have to check the byte order flag to see what byte order all the
  4591. # other stuff in the header is in.
  4592. #
  4593. # What're the correct byte orders for the nCUBE and the Fujitsu VPP500?
  4594. #
  4595. # Created by: unknown
  4596. # Modified by (1): Daniel Quinlan <quinlan@yggdrasil.com>
  4597. # Modified by (2): Peter Tobias <tobias@server.et-inf.fho-emden.de> (core support)
  4598. # Modified by (3): Christian 'Dr. Disk' Hechelmann <drdisk@ds9.au.s.shuttle.de> (fix of core support)
  4599. # Modified by (4): <gerardo.cacciari@gmail.com> (VMS Itanium)
  4600. # Modified by (5): Matthias Urlichs <smurf@debian.org> (Listing of many architectures)
  4601. 0    string        \177ELF        ELF
  4602. >4    byte        0        invalid class
  4603. >4    byte        1        32-bit
  4604. >4    byte        2        64-bit
  4605. >5    byte        0        invalid byte order
  4606. >5    byte        1        LSB
  4607. >>16    leshort        0        no file type,
  4608. !:strength *2
  4609. !:mime    application/octet-stream
  4610. >>16    leshort        1        relocatable,
  4611. !:mime    application/x-object
  4612. >>16    leshort        2        executable,
  4613. !:mime    application/x-executable
  4614. >>16    leshort        3        shared object,
  4615. !:mime    application/x-sharedlib
  4616. >>16    leshort        4        core file
  4617. !:mime    application/x-coredump
  4618. # Core file detection is not reliable.
  4619. #>>>(0x38+0xcc) string    >\0        of '%s'
  4620. #>>>(0x38+0x10) lelong    >0        (signal %d),
  4621. >>16    leshort        &0xff00        processor-specific,
  4622. >>18    leshort        0        no machine,
  4623. >>18    leshort        1        AT&T WE32100 - invalid byte order,
  4624. >>18    leshort        2        SPARC - invalid byte order,
  4625. >>18    leshort        3        Intel 80386,
  4626. >>18    leshort        4        Motorola
  4627. >>>36    lelong        &0x01000000    68000 - invalid byte order,
  4628. >>>36    lelong        &0x00810000    CPU32 - invalid byte order,
  4629. >>>36    lelong        0        68020 - invalid byte order,
  4630. >>18    leshort        5        Motorola 88000 - invalid byte order,
  4631. >>18    leshort        6        Intel 80486,
  4632. >>18    leshort        7        Intel 80860,
  4633. # The official e_machine number for MIPS is now #8, regardless of endianness.
  4634. # The second number (#10) will be deprecated later. For now, we still
  4635. # say something if #10 is encountered, but only gory details for #8.
  4636. >>18    leshort        8        MIPS,
  4637. >>>36    lelong        &0x20        N32
  4638. >>18    leshort        10        MIPS,
  4639. >>>36    lelong        &0x20        N32
  4640. >>18    leshort        8
  4641. # only for 32-bit
  4642. >>>4    byte        1
  4643. >>>>36  lelong&0xf0000000    0x00000000    MIPS-I
  4644. >>>>36  lelong&0xf0000000    0x10000000    MIPS-II
  4645. >>>>36  lelong&0xf0000000    0x20000000    MIPS-III
  4646. >>>>36  lelong&0xf0000000    0x30000000    MIPS-IV
  4647. >>>>36  lelong&0xf0000000    0x40000000    MIPS-V
  4648. >>>>36  lelong&0xf0000000    0x50000000    MIPS32
  4649. >>>>36  lelong&0xf0000000    0x60000000    MIPS64
  4650. >>>>36  lelong&0xf0000000    0x70000000    MIPS32 rel2
  4651. >>>>36  lelong&0xf0000000    0x80000000    MIPS64 rel2
  4652. # only for 64-bit
  4653. >>>4    byte        2
  4654. >>>>48  lelong&0xf0000000    0x00000000    MIPS-I
  4655. >>>>48  lelong&0xf0000000    0x10000000    MIPS-II
  4656. >>>>48  lelong&0xf0000000    0x20000000    MIPS-III
  4657. >>>>48  lelong&0xf0000000    0x30000000    MIPS-IV
  4658. >>>>48  lelong&0xf0000000    0x40000000    MIPS-V
  4659. >>>>48  lelong&0xf0000000    0x50000000    MIPS32
  4660. >>>>48  lelong&0xf0000000    0x60000000    MIPS64
  4661. >>>>48  lelong&0xf0000000    0x70000000    MIPS32 rel2
  4662. >>>>48  lelong&0xf0000000    0x80000000    MIPS64 rel2
  4663. >>18    leshort        9        Amdahl - invalid byte order,
  4664. >>18    leshort        10        MIPS (deprecated),
  4665. >>18    leshort        11        RS6000 - invalid byte order,
  4666. >>18    leshort        15        PA-RISC - invalid byte order,
  4667. >>>50    leshort        0x0214        2.0
  4668. >>>48    leshort        &0x0008        (LP64),
  4669. >>18    leshort        16        nCUBE,
  4670. >>18    leshort        17        Fujitsu VPP500,
  4671. >>18    leshort        18        SPARC32PLUS - invalid byte order,
  4672. >>18    leshort        20        PowerPC,
  4673. >>18    leshort        22        IBM S/390,
  4674. >>18    leshort        36        NEC V800,
  4675. >>18    leshort        37        Fujitsu FR20,
  4676. >>18    leshort        38        TRW RH-32,
  4677. >>18    leshort        39        Motorola RCE,
  4678. >>18    leshort        40        ARM,
  4679. >>18    leshort        41        Alpha,
  4680. >>18    leshort        0xa390        IBM S/390 (obsolete),
  4681. >>18    leshort        42        Renesas SH,
  4682. >>18    leshort        43        SPARC V9 - invalid byte order,
  4683. >>18    leshort        44        Siemens Tricore Embedded Processor,
  4684. >>18    leshort        45        Argonaut RISC Core, Argonaut Technologies Inc.,
  4685. >>18    leshort        46        Renesas H8/300,
  4686. >>18    leshort        47        Renesas H8/300H,
  4687. >>18    leshort        48        Renesas H8S,
  4688. >>18    leshort        49        Renesas H8/500,
  4689. >>18    leshort        50        IA-64,
  4690. >>18    leshort        51        Stanford MIPS-X,
  4691. >>18    leshort        52        Motorola Coldfire,
  4692. >>18    leshort        53        Motorola M68HC12,
  4693. >>18    leshort        54        Fujitsu MMA,
  4694. >>18    leshort        55        Siemens PCP,
  4695. >>18    leshort        56        Sony nCPU,
  4696. >>18    leshort        57        Denso NDR1,
  4697. >>18    leshort        58        Start*Core,
  4698. >>18    leshort        59        Toyota ME16,
  4699. >>18    leshort        60        ST100,
  4700. >>18    leshort        61        Tinyj emb.,
  4701. >>18    leshort        62        x86-64,
  4702. >>18    leshort        63        Sony DSP,
  4703. >>18    leshort        66        FX66,
  4704. >>18    leshort        67        ST9+ 8/16 bit,
  4705. >>18    leshort        68        ST7 8 bit,
  4706. >>18    leshort        69        MC68HC16,
  4707. >>18    leshort        70        MC68HC11,
  4708. >>18    leshort        71        MC68HC08,
  4709. >>18    leshort        72        MC68HC05,
  4710. >>18    leshort        73        SGI SVx,
  4711. >>18    leshort        74        ST19 8 bit,
  4712. >>18    leshort        75        Digital VAX,
  4713. >>18    leshort        76        Axis cris,
  4714. >>18    leshort        77        Infineon 32-bit embedded,
  4715. >>18    leshort        78        Element 14 64-bit DSP,
  4716. >>18    leshort        79        LSI Logic 16-bit DSP,
  4717. >>18    leshort        80        MMIX,
  4718. >>18    leshort        81        Harvard machine-independent,
  4719. >>18    leshort        82        SiTera Prism,
  4720. >>18    leshort        83        Atmel AVR 8-bit,
  4721. >>18    leshort        84        Fujitsu FR30,
  4722. >>18    leshort        85        Mitsubishi D10V,
  4723. >>18    leshort        86        Mitsubishi D30V,
  4724. >>18    leshort        87        NEC v850,
  4725. >>18    leshort        88        Renesas M32R,
  4726. >>18    leshort        89        Matsushita MN10300,
  4727. >>18    leshort        90        Matsushita MN10200,
  4728. >>18    leshort        91        picoJava,
  4729. >>18    leshort        92        OpenRISC,
  4730. >>18    leshort        93        ARC Cores Tangent-A5,
  4731. >>18    leshort        0x3426        OpenRISC (obsolete),
  4732. >>18    leshort        0x8472        OpenRISC (obsolete),
  4733. >>18    leshort        94        Tensilica Xtensa,
  4734. >>18    leshort        97        NatSemi 32k,
  4735. >>18    leshort        106        Analog Devices Blackfin,
  4736. >>18    leshort        0x9026        Alpha (unofficial),
  4737. >>20    lelong        0        invalid version
  4738. >>20    lelong        1        version 1
  4739. >>36    lelong        1        MathCoPro/FPU/MAU Required
  4740. >5    byte        2        MSB
  4741. >>16    beshort        0        no file type,
  4742. !:mime    application/octet-stream
  4743. >>16    beshort        1        relocatable,
  4744. !:mime    application/x-object
  4745. >>16    beshort        2        executable,
  4746. !:mime    application/x-executable
  4747. >>16    beshort        3        shared object,
  4748. !:mime    application/x-sharedlib
  4749. >>16    beshort        4        core file,
  4750. !:mime    application/x-coredump
  4751. #>>>(0x38+0xcc) string    >\0        of '%s'
  4752. #>>>(0x38+0x10) belong    >0        (signal %d),
  4753. >>16    beshort        &0xff00        processor-specific,
  4754. >>18    beshort        0        no machine,
  4755. >>18    beshort        1        AT&T WE32100,
  4756. >>18    beshort        2        SPARC,
  4757. >>18    beshort        3        Intel 80386 - invalid byte order,
  4758. >>18    beshort        4        Motorola
  4759. >>>36    belong        &0x01000000    68000,
  4760. >>>36    belong        &0x00810000    CPU32,
  4761. >>>36    belong        0        68020,
  4762. >>18    beshort        5        Motorola 88000,
  4763. >>18    beshort        6        Intel 80486 - invalid byte order,
  4764. >>18    beshort        7        Intel 80860,
  4765. # only for MIPS - see comment in little-endian section above.
  4766. >>18    beshort        8        MIPS,
  4767. >>>36    belong        &0x20        N32
  4768. >>18    beshort        10        MIPS,
  4769. >>>36    belong        &0x20        N32
  4770. >>18    beshort        8
  4771. # only for 32-bit
  4772. >>>4    byte        1
  4773. >>>>36  belong&0xf0000000    0x00000000    MIPS-I
  4774. >>>>36  belong&0xf0000000    0x10000000    MIPS-II
  4775. >>>>36  belong&0xf0000000    0x20000000    MIPS-III
  4776. >>>>36  belong&0xf0000000    0x30000000    MIPS-IV
  4777. >>>>36  belong&0xf0000000    0x40000000    MIPS-V
  4778. >>>>36  belong&0xf0000000    0x50000000    MIPS32
  4779. >>>>36  belong&0xf0000000    0x60000000    MIPS64
  4780. >>>>36  belong&0xf0000000    0x70000000    MIPS32 rel2
  4781. >>>>36  belong&0xf0000000    0x80000000    MIPS64 rel2
  4782. # only for 64-bit
  4783. >>>4    byte        2
  4784. >>>>48    belong&0xf0000000    0x00000000    MIPS-I
  4785. >>>>48    belong&0xf0000000    0x10000000    MIPS-II
  4786. >>>>48    belong&0xf0000000    0x20000000    MIPS-III
  4787. >>>>48    belong&0xf0000000    0x30000000    MIPS-IV
  4788. >>>>48    belong&0xf0000000    0x40000000    MIPS-V
  4789. >>>>48    belong&0xf0000000    0x50000000    MIPS32
  4790. >>>>48    belong&0xf0000000    0x60000000    MIPS64
  4791. >>>>48    belong&0xf0000000    0x70000000    MIPS32 rel2
  4792. >>>>48    belong&0xf0000000    0x80000000    MIPS64 rel2
  4793. >>18    beshort        9        Amdahl,
  4794. >>18    beshort        10        MIPS (deprecated),
  4795. >>18    beshort        11        RS6000,
  4796. >>18    beshort        15        PA-RISC
  4797. >>>50    beshort        0x0214        2.0
  4798. >>>48    beshort        &0x0008        (LP64)
  4799. >>18    beshort        16        nCUBE,
  4800. >>18    beshort        17        Fujitsu VPP500,
  4801. >>18    beshort        18        SPARC32PLUS,
  4802. >>>36    belong&0xffff00    0x000100    V8+ Required,
  4803. >>>36    belong&0xffff00    0x000200    Sun UltraSPARC1 Extensions Required,
  4804. >>>36    belong&0xffff00    0x000400    HaL R1 Extensions Required,
  4805. >>>36    belong&0xffff00    0x000800    Sun UltraSPARC3 Extensions Required,
  4806. >>18    beshort        20        PowerPC or cisco 4500,
  4807. >>18    beshort        21        64-bit PowerPC or cisco 7500,
  4808. >>18    beshort        22        IBM S/390,
  4809. >>18    beshort        23        Cell SPU,
  4810. >>18    beshort        24        cisco SVIP,
  4811. >>18    beshort        25        cisco 7200,
  4812. >>18    beshort        36        NEC V800 or cisco 12000,
  4813. >>18    beshort        37        Fujitsu FR20,
  4814. >>18    beshort        38        TRW RH-32,
  4815. >>18    beshort        39        Motorola RCE,
  4816. >>18    beshort        40        ARM,
  4817. >>18    beshort        41        Alpha,
  4818. >>18    beshort        42        Renesas SH,
  4819. >>18    beshort        43        SPARC V9,
  4820. >>>48    belong&0xffff00    0x000200    Sun UltraSPARC1 Extensions Required,
  4821. >>>48    belong&0xffff00    0x000400    HaL R1 Extensions Required,
  4822. >>>48    belong&0xffff00    0x000800    Sun UltraSPARC3 Extensions Required,
  4823. >>>48    belong&0x3    0        total store ordering,
  4824. >>>48    belong&0x3    1        partial store ordering,
  4825. >>>48    belong&0x3    2        relaxed memory ordering,
  4826. >>18    beshort        44        Siemens Tricore Embedded Processor,
  4827. >>18    beshort        45        Argonaut RISC Core, Argonaut Technologies Inc.,
  4828. >>18    beshort        46        Renesas H8/300,
  4829. >>18    beshort        47        Renesas H8/300H,
  4830. >>18    beshort        48        Renesas H8S,
  4831. >>18    beshort        49        Renesas H8/500,
  4832. >>18    beshort        50        IA-64,
  4833. >>18    beshort        51        Stanford MIPS-X,
  4834. >>18    beshort        52        Motorola Coldfire,
  4835. >>18    beshort        53        Motorola M68HC12,
  4836. >>18    beshort        73        Cray NV1,
  4837. >>18    beshort        75        Digital VAX,
  4838. >>18    beshort        88        Renesas M32R,
  4839. >>18    leshort        92        OpenRISC,
  4840. >>18    leshort        0x3426        OpenRISC (obsolete),
  4841. >>18    leshort        0x8472        OpenRISC (obsolete),
  4842. >>18    beshort        94        Tensilica Xtensa,
  4843. >>18    beshort        97        NatSemi 32k,
  4844. >>18    beshort        0x18ad        AVR32 (unofficial),
  4845. >>18    beshort        0x9026        Alpha (unofficial),
  4846. >>18    beshort        0xa390        IBM S/390 (obsolete),
  4847. >>20    belong        0        invalid version
  4848. >>20    belong        1        version 1
  4849. >>36    belong        1        MathCoPro/FPU/MAU Required
  4850. # Up to now only 0, 1 and 2 are defined; I've seen a file with 0x83, it seemed
  4851. # like proper ELF, but extracting the string had bad results.
  4852. >4      byte            <0x80
  4853. >>8    string        >\0        (%s)
  4854. >8    string        \0
  4855. >>7    byte        0        (SYSV)
  4856. >>7    byte        1        (HP-UX)
  4857. >>7    byte        2        (NetBSD)
  4858. >>7    byte        3        (GNU/Linux)
  4859. >>7    byte        4        (GNU/Hurd)
  4860. >>7    byte        5        (86Open)
  4861. >>7    byte        6        (Solaris)
  4862. >>7    byte        7        (Monterey)
  4863. >>7    byte        8        (IRIX)
  4864. >>7    byte        9        (FreeBSD)
  4865. >>7    byte        10        (Tru64)
  4866. >>7    byte        11        (Novell Modesto)
  4867. >>7    byte        12        (OpenBSD)
  4868. >8      string          \2
  4869. >>7     byte            13              (OpenVMS)
  4870. >>7    byte        97        (ARM)
  4871. >>7    byte        255        (embedded)
  4872.  
  4873. #------------------------------------------------------------------------------
  4874. # encore:  file(1) magic for Encore machines
  4875. #
  4876. # XXX - needs to have the byte order specified (NS32K was little-endian,
  4877. # dunno whether they run the 88K in little-endian mode or not).
  4878. #
  4879. 0    short        0x154        Encore
  4880. >20    short        0x107        executable
  4881. >20    short        0x108        pure executable
  4882. >20    short        0x10b        demand-paged executable
  4883. >20    short        0x10f        unsupported executable
  4884. >12    long        >0        not stripped
  4885. >22    short        >0        - version %ld
  4886. >22    short        0        -
  4887. #>4    date        x        stamp %s
  4888. 0    short        0x155        Encore unsupported executable
  4889. >12    long        >0        not stripped
  4890. >22    short        >0        - version %ld
  4891. >22    short        0        -
  4892. #>4    date        x        stamp %s
  4893.  
  4894. #------------------------------------------------------------------------------
  4895. # Epoc 32 : file(1) magic for Epoc Documents [psion/osaris
  4896. # Stefan Praszalowicz (hpicollo@worldnet.fr)
  4897. #0    lelong        0x10000037    Epoc32
  4898. >4    lelong        0x1000006D
  4899. >>8    lelong        0x1000007F    Word
  4900. >>8    lelong        0x10000088    Sheet
  4901. >>8    lelong        0x1000007D    Sketch
  4902. >>8    lelong        0x10000085    TextEd
  4903.  
  4904. #------------------------------------------------------------------------------
  4905. # erlang:  file(1) magic for Erlang JAM and BEAM files
  4906. # URL:  http://www.erlang.org/faq/x779.html#AEN812
  4907.  
  4908. # OTP R3-R4
  4909. 0    string    \0177BEAM!    Old Erlang BEAM file
  4910. >6    short    >0        - version %d
  4911.  
  4912. # OTP R5 and onwards
  4913. 0    string    FOR1
  4914. >8    string    BEAM        Erlang BEAM file
  4915.  
  4916. # 4.2 version may have a copyright notice!
  4917. 4    string    Tue\ Jan\ 22\ 14:32:44\ MET\ 1991    Erlang JAM file - version 4.2
  4918. 79    string    Tue\ Jan\ 22\ 14:32:44\ MET\ 1991    Erlang JAM file - version 4.2
  4919.  
  4920. 4    string    1.0\ Fri\ Feb\ 3\ 09:55:56\ MET\ 1995    Erlang JAM file - version 4.3
  4921.  
  4922. #------------------------------------------------------------------------------
  4923. # ESRI Shapefile format (.shp .shx .dbf=DBaseIII)
  4924. # Based on info from
  4925. # <URL:http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf>
  4926. 0    belong    9994    ESRI Shapefile
  4927. >4    belong    =0
  4928. >8    belong    =0
  4929. >12    belong    =0
  4930. >16    belong    =0
  4931. >20    belong    =0
  4932. >28    lelong    x    version %d
  4933. >24    belong    x    length %d
  4934. >32    lelong    =0    type Null Shape
  4935. >32    lelong    =1    type Point
  4936. >32    lelong    =3    type PolyLine
  4937. >32    lelong    =5    type Polygon
  4938. >32    lelong    =8    type MultiPoint
  4939. >32    lelong    =11    type PointZ
  4940. >32    lelong    =13    type PolyLineZ
  4941. >32    lelong    =15    type PolygonZ
  4942. >32    lelong    =18    type MultiPointZ
  4943. >32    lelong    =21    type PointM
  4944. >32    lelong    =23    type PolyLineM
  4945. >32    lelong    =25    type PolygonM
  4946. >32    lelong    =28    type MultiPointM
  4947. >32    lelong    =31    type MultiPatch
  4948.  
  4949. #------------------------------------------------------------------------------
  4950. # fcs: file(1) magic for FCS (Flow Cytometry Standard) data files
  4951. # From Roger Leigh <roger@whinlatter.uklinux.net>
  4952. 0       string          FCS1.0          Flow Cytometry Standard (FCS) data, version 1.0
  4953. 0       string          FCS2.0          Flow Cytometry Standard (FCS) data, version 2.0
  4954. 0       string          FCS3.0          Flow Cytometry Standard (FCS) data, version 3.0
  4955.  
  4956.  
  4957. #------------------------------------------------------------------------------
  4958. # filesystems:  file(1) magic for different filesystems
  4959. #
  4960. 0    string    \366\366\366\366    PC formatted floppy with no filesystem
  4961. # Sun disk labels
  4962. # From /usr/include/sun/dklabel.h:
  4963. 0774    beshort        0xdabe        
  4964. # modified by Joerg Jenderek, because original test
  4965. # succeeds for Cabinet archive dao360.dl_ with negative blocks
  4966. >0770    long        >0        Sun disk label
  4967. >>0    string        x        '%s
  4968. >>>31    string        >\0        \b%s
  4969. >>>>63    string        >\0        \b%s
  4970. >>>>>95    string        >\0        \b%s
  4971. >>0    string        x        \b'
  4972. >>0734    short        >0        %d rpm,
  4973. >>0736    short        >0        %d phys cys,
  4974. >>0740    short        >0        %d alts/cyl,
  4975. >>0746    short        >0        %d interleave,
  4976. >>0750    short        >0        %d data cyls,
  4977. >>0752    short        >0        %d alt cyls,
  4978. >>0754    short        >0        %d heads/partition,
  4979. >>0756    short        >0        %d sectors/track,
  4980. >>0764    long        >0        start cyl %ld,
  4981. >>0770    long        x        %ld blocks
  4982. # Is there a boot block written 1 sector in?
  4983. >512    belong&077777777    0600407    \b, boot block present
  4984. # Joerg Jenderek: Smart Boot Manager backup file is 41 byte header + first sectors of disc
  4985. # (http://btmgr.sourceforge.net/docs/user-guide-3.html)
  4986. 0        string    SBMBAKUP_    Smart Boot Manager backup file
  4987. >9        string    x        \b, version %-5.5s
  4988. >>14        string    =_        
  4989. >>>15        string    x        %-.1s
  4990. >>>>16        string    =_        \b.
  4991. >>>>>17        string    x        \b%-.1s
  4992. >>>>>>18    string    =_        \b.
  4993. >>>>>>>19    string    x        \b%-.1s
  4994. >>>22        ubyte    0        
  4995. >>>>21        ubyte    x        \b, from drive 0x%x
  4996. >>>22        ubyte    >0        
  4997. >>>>21        string    x        \b, from drive %s
  4998.  
  4999. # Joerg Jenderek
  5000. # DOS Emulator image is 128 byte, null right padded header + harddisc image
  5001. 0    string    DOSEMU\0            
  5002. >0x27E    leshort    0xAA55            
  5003. #offset is 128
  5004. >>19    ubyte    128            
  5005. >>>(19.b-1)    ubyte    0x0    DOS Emulator image
  5006. >>>>7    ulelong    >0        \b, %u heads
  5007. >>>>11    ulelong    >0        \b, %d sectors/track
  5008. >>>>15    ulelong    >0        \b, %d cylinders
  5009.  
  5010. # updated by Joerg Jenderek at Sep 2007
  5011. # only for sector sizes with 512 or more Bytes
  5012. 0x1FE    leshort    0xAA55            x86 boot sector
  5013. # to do also for sectors < than 512 Bytes and some other files, GRR
  5014. #30    search/481    \x55\xAA    x86 boot sector
  5015. # not for BeOS floppy 1440k, MBRs
  5016. #(11.s-2) uleshort    0xAA55        x86 boot sector
  5017. >2    string    OSBS            \b, OS/BS MBR
  5018. # J\xf6rg Jenderek <joerg dot jenderek at web dot de>
  5019. >0x8C    string    Invalid\ partition\ table    \b, MS-DOS MBR
  5020. # dr-dos with some upper-, lowercase variants
  5021. >0x9D    string    Invalid\ partition\ table$    
  5022. >>181    string    No\ Operating\ System$        
  5023. >>>201    string    Operating\ System\ load\ error$    \b, DR-DOS MBR, Version 7.01 to 7.03
  5024. >0x9D    string    Invalid\ partition\ table$    
  5025. >>181    string    No\ operating\ system$        
  5026. >>>201    string    Operating\ system\ load\ error$    \b, DR-DOS MBR, Version 7.01 to 7.03
  5027. >342    string    Invalid\ partition\ table$    
  5028. >>366    string    No\ operating\ system$        
  5029. >>>386    string    Operating\ system\ load\ error$    \b, DR-DOS MBR, version 7.01 to 7.03
  5030. >295    string    NEWLDR\0                
  5031. >>302    string    Bad\ PT\ $                
  5032. >>>310    string    No\ OS\ $                
  5033. >>>>317    string    OS\ load\ err$                
  5034. >>>>>329    string    Moved\ or\ missing\ IBMBIO.LDR\n\r    
  5035. >>>>>>358    string    Press\ any\ key\ to\ continue.\n\r$    
  5036. >>>>>>>387    string    Copyright\ (c)\ 1984,1998    
  5037. >>>>>>>>411    string    Caldera\ Inc.\0        \b, DR-DOS MBR (IBMBIO.LDR)
  5038. >0x10F    string    Ung\201ltige\ Partitionstabelle    \b, MS-DOS MBR, german version 4.10.1998, 4.10.2222
  5039. >>0x1B8    ubelong    >0                \b, Serial 0x%-.4x
  5040. >0x8B    string    Ung\201ltige\ Partitionstabelle    \b, MS-DOS MBR, german version 5.00 to 4.00.950
  5041. >271    string    Invalid\ partition\ table\0        
  5042. >>295    string    Error\ loading\ operating\ system\0    
  5043. >>>326    string    Missing\ operating\ system\0        \b, mbr
  5044. #
  5045. >139    string    Invalid\ partition\ table\0        
  5046. >>163    string    Error\ loading\ operating\ system\0    
  5047. >>>194    string    Missing\ operating\ system\0        \b, Microsoft Windows XP mbr
  5048. # http://www.heise.de/ct/05/09/006/ page 184
  5049. #HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices\DosDevices\?:=Serial4Bytes+8Bytes
  5050. >>>>0x1B8    ulelong    >0                \b,Serial 0x%-.4x
  5051. >300    string    Invalid\ partition\ table\0    
  5052. >>324    string    Error\ loading\ operating\ system\0
  5053. >>>355    string    Missing\ operating\ system\0        \b, Microsoft Windows XP MBR
  5054. #??>>>389    string    Invalid\ system\ disk        
  5055. >>>>0x1B8    ulelong    >0                \b, Serial 0x%-.4x
  5056. >300    string    Ung\201ltige\ Partitionstabelle
  5057. #split string to avoid error: String too long
  5058. >>328    string    Fehler\ beim\ Laden\     
  5059. >>>346    string    des\ Betriebssystems    
  5060. >>>>366    string    Betriebssystem\ nicht\ vorhanden    \b, Microsoft Windows XP MBR (german)
  5061. >>>>>0x1B8    ulelong    >0                \b, Serial 0x%-.4x
  5062. >0x145    string    Default:\ F                \b, FREE-DOS MBR
  5063. >64    string    no\ active\ partition\ found    
  5064. >>96    string    read\ error\ while\ reading\ drive    \b, FREE-DOS Beta 0.9 MBR
  5065. >271    string    Operating\ system\ loading         
  5066. >>296    string    error\r                    \b, SYSLINUX MBR (2.10)
  5067. # http://www.acronis.de/
  5068. >362    string    MBR\ Error\ \0\r            
  5069. >>376    string    ress\ any\ key\ to\             
  5070. >>>392    string    boot\ from\ floppy...\0            \b, Acronis MBR
  5071. # added by Joerg Jenderek
  5072. # http://www.visopsys.org/
  5073. # http://partitionlogic.org.uk/
  5074. >309    string    No\ bootable\ partition\ found\r    
  5075. >>339    string    I/O\ Error\ reading\ boot\ sector\r    \b, Visopsys MBR
  5076. >349    string    No\ bootable\ partition\ found\r    
  5077. >>379    string    I/O\ Error\ reading\ boot\ sector\r    \b, simple Visopsys MBR
  5078. # bootloader, bootmanager
  5079. >0x40    string    SBML                
  5080. # label with 11 characters of FAT 12 bit filesystem
  5081. >>43    string    SMART\ BTMGR            
  5082. >>>430    string    SBMK\ Bad!\r            
  5083. >>>>3    string    SBM                \b, Smart Boot Manager
  5084. >>>>>6    string    >\0                             \b, version %s
  5085. >382    string    XOSLLOADXCF            \b, eXtended Operating System Loader
  5086. >6    string    LILO                \b, LInux i386 boot LOader
  5087. >>120    string    LILO                \b, version 22.3.4 SuSe
  5088. >>172    string    LILO                \b, version 22.5.8 Debian
  5089. # updated by Joerg Jenderek
  5090. # variables according to grub-0.97/stage1/stage1.S or
  5091. # http://www.gnu.org/software/grub/manual/grub.html#Embedded-data
  5092. # usual values are marked with comments to get only informations of strange GRUB loaders
  5093. >0        ulelong        0x009048EB    
  5094. >>0x41        ubyte        <2        
  5095. >>>0x3E        ubyte        >2        \b; GRand Unified Bootloader
  5096. # 0x3 for 0.5.95,0.93,0.94,0.96 0x4 for 1.90 
  5097. >>>>0x3E    ubyte        x        \b, stage1 version 0x%x
  5098. #If it is 0xFF, use a drive passed by BIOS
  5099. >>>>0x40    ubyte        <0xFF        \b, boot drive 0x%x
  5100. # in most case 0,1,0x2e for GRUB 0.5.95
  5101. >>>>0x41    ubyte        >0        \b, LBA flag 0x%x
  5102. >>>>0x42    uleshort    <0x8000        \b, stage2 address 0x%x
  5103. #>>>>0x42    uleshort    =0x8000        \b, stage2 address 0x%x (usual)
  5104. >>>>0x42    uleshort    >0x8000        \b, stage2 address 0x%x
  5105. #>>>>0x44    ulelong        =1        \b, 1st sector stage2 0x%x (default)
  5106. >>>>0x44    ulelong        >1        \b, 1st sector stage2 0x%x
  5107. >>>>0x48    uleshort    <0x800        \b, stage2 segment 0x%x
  5108. #>>>>0x48    uleshort    =0x800        \b, stage2 segment 0x%x (usual)
  5109. >>>>0x48    uleshort    >0x800        \b, stage2 segment 0x%x
  5110. >>>>402        string    Geom\0Hard\ Disk\0Read\0\ Error\0
  5111. >>>>>394    string    stage1            \b, GRUB version 0.5.95
  5112. >>>>382        string    Geom\0Hard\ Disk\0Read\0\ Error\0
  5113. >>>>>376    string    GRUB\ \0        \b, GRUB version 0.93 or 1.94
  5114. >>>>383        string    Geom\0Hard\ Disk\0Read\0\ Error\0
  5115. >>>>>377    string    GRUB\ \0        \b, GRUB version 0.94
  5116. >>>>385        string    Geom\0Hard\ Disk\0Read\0\ Error\0
  5117. >>>>>379    string    GRUB\ \0        \b, GRUB version 0.95 or 0.96
  5118. >>>>391        string    Geom\0Hard\ Disk\0Read\0\ Error\0
  5119. >>>>>385    string    GRUB\ \0        \b, GRUB version 0.97
  5120. #unkown version
  5121. >>>343        string    Geom\0Read\0\ Error\0    
  5122. >>>>321        string    Loading\ stage1.5    \b, GRUB version x.y
  5123. >>>380        string    Geom\0Hard\ Disk\0Read\0\ Error\0
  5124. >>>>374        string    GRUB\ \0        \b, GRUB version n.m
  5125. # http://syslinux.zytor.com/
  5126. >478    string    Boot\ failed\r            
  5127. >>495    string    LDLINUX\ SYS            \b, SYSLINUX bootloader (1.62)
  5128. >480    string    Boot\ failed\r            
  5129. >>495    string    LDLINUX\ SYS            \b, SYSLINUX bootloader (2.06 or 2.11)
  5130. >484    string    Boot\ error\r            \b, SYSLINUX bootloader (3.11)
  5131. >395    string    chksum\0\ ERROR!\0        \b, Gujin bootloader
  5132. # http://www.bcdwb.de/bcdw/index_e.htm
  5133. >3    string    BCDL                
  5134. >>498    string    BCDL\ \ \ \ BIN            \b, Bootable CD Loader (1.50Z)
  5135. # mbr partion table entries
  5136. # OEM-ID not Microsoft,SYSLINUX,or MTOOLs
  5137. >3            string        !MS
  5138. >>3            string        !SYSLINUX
  5139. >>>3            string        !MTOOL
  5140. # not FAT (32 bit)
  5141. >>>>82            string        !FAT32    
  5142. #not IO.SYS
  5143. >>>>>472        string        !IO\ \ \ \ \ \ SYS
  5144. >>>>>>480        string        !IO\ \ \ \ \ \ SYS
  5145. #not Linux kernel
  5146. >>>>>>>514        string        !HdrS
  5147. #not BeOS
  5148. >>>>>>>>422        string        !Be\ Boot\ Loader
  5149. # active flag 0 or 0x80 and type > 0
  5150. >>>>>>>>>446        ubyte        <0x81    
  5151. >>>>>>>>>>446        ubyte&0x7F    0    
  5152. >>>>>>>>>>>450        ubyte        >0    \b; partition 1: ID=0x%x
  5153. >>>>>>>>>>>>446        ubyte        0x80    \b, active
  5154. >>>>>>>>>>>>447        ubyte        x    \b, starthead %u
  5155. #>>>>>>>>>>>>448        ubyte        x    \b, start C_S: 0x%x
  5156. #>>>>>>>>>>>>448        ubeshort&1023    x    \b, startcylinder? %d
  5157. >>>>>>>>>>>>454        ulelong        x    \b, startsector %u
  5158. >>>>>>>>>>>>458        ulelong        x    \b, %u sectors
  5159. #
  5160. >>>>>>>>>462        ubyte        <0x81    
  5161. >>>>>>>>>>462        ubyte&0x7F    0        
  5162. >>>>>>>>>>>466        ubyte        >0    \b; partition 2: ID=0x%x
  5163. >>>>>>>>>>>>462        ubyte        0x80    \b, active
  5164. >>>>>>>>>>>>463        ubyte        x    \b, starthead %u
  5165. #>>>>>>>>>>>>464        ubyte        x    \b, start C_S: 0x%x
  5166. #>>>>>>>>>>>>464        ubeshort&1023    x    \b, startcylinder? %d
  5167. >>>>>>>>>>>>470        ulelong        x    \b, startsector %u
  5168. >>>>>>>>>>>>474        ulelong        x    \b, %u sectors
  5169. #
  5170. >>>>>>>>>478        ubyte        <0x81        
  5171. >>>>>>>>>>478        ubyte&0x7F    0        
  5172. >>>>>>>>>>>482        ubyte        >0    \b; partition 3: ID=0x%x
  5173. >>>>>>>>>>>>478        ubyte        0x80    \b, active
  5174. >>>>>>>>>>>>479        ubyte        x    \b, starthead %u
  5175. #>>>>>>>>>>>>480        ubyte        x    \b, start C_S: 0x%x
  5176. #>>>>>>>>>>>>481        ubyte        x    \b, start C2S: 0x%x
  5177. #>>>>>>>>>>>>480        ubeshort&1023    x    \b, startcylinder? %d
  5178. >>>>>>>>>>>>486        ulelong        x    \b, startsector %u
  5179. >>>>>>>>>>>>490        ulelong        x    \b, %u sectors
  5180. #
  5181. >>>>>>>>>494        ubyte        <0x81    
  5182. >>>>>>>>>>494        ubyte&0x7F    0        
  5183. >>>>>>>>>>>498        ubyte        >0    \b; partition 4: ID=0x%x
  5184. >>>>>>>>>>>>494        ubyte        0x80    \b, active
  5185. >>>>>>>>>>>>495        ubyte        x    \b, starthead %u
  5186. #>>>>>>>>>>>>496        ubyte        x    \b, start C_S: 0x%x
  5187. #>>>>>>>>>>>>496        ubeshort&1023    x    \b, startcylinder? %d
  5188. >>>>>>>>>>>>502        ulelong        x    \b, startsector %u
  5189. >>>>>>>>>>>>506        ulelong        x    \b, %u sectors
  5190. # mbr partion table entries end
  5191. # http://www.acronis.de/
  5192. #FAT label=ACRONIS\ SZ
  5193. #OEM-ID=BOOTWIZ0
  5194. >442    string    Non-system\ disk,\     
  5195. >>459    string    press\ any\ key...\x7\0        \b, Acronis Startup Recovery Loader
  5196. # DOS names like F11.SYS are 8 right space padded bytes+3 bytes
  5197. >>>477        ubyte&0xDF    >0        
  5198. >>>>477        string        x         \b %-.3s
  5199. >>>>>480    ubyte&0xDF    >0        
  5200. >>>>>>480    string        x         \b%-.5s
  5201. >>>>485        ubyte&0xDF    >0        
  5202. >>>>>485    string        x         \b.%-.3s
  5203. #
  5204. >185    string    FDBOOT\ Version\             
  5205. >>204    string    \rNo\ Systemdisk.\             
  5206. >>>220    string    Booting\ from\ harddisk.\n\r        
  5207. >>>245    string    Cannot\ load\ from\ harddisk.\n\r    
  5208. >>>>273 string    Insert\ Systemdisk\             
  5209. >>>>>291 string and\ press\ any\ key.\n\r        \b, FDBOOT harddisk Bootloader
  5210. >>>>>>200 string    >\0                             \b, version %-3s
  5211. >242    string    Bootsector\ from\ C.H.\ Hochst\204    
  5212. >>278    string    No\ Systemdisk.\             
  5213. >>>293    string    Booting\ from\ harddisk.\n\r        
  5214. >>>441    string    Cannot\ load\ from\ harddisk.\n\r    
  5215. >>>>469 string    Insert\ Systemdisk\             
  5216. >>>>>487 string and\ press\ any\ key.\n\r        \b, WinImage harddisk Bootloader
  5217. >>>>>>209 string    >\0                             \b, version %-4.4s
  5218. >(1.b+2)    ubyte        0xe            
  5219. >>(1.b+3)    ubyte        0x1f            
  5220. >>>(1.b+4)    ubyte        0xbe            
  5221. >>>>(1.b+5)    ubyte        0x77            
  5222. >>>>(1.b+6)    ubyte        0x7c            
  5223. >>>>>(1.b+7)    ubyte        0xac            
  5224. >>>>>>(1.b+8)    ubyte        0x22            
  5225. >>>>>>>(1.b+9)    ubyte        0xc0            
  5226. >>>>>>>>(1.b+10)    ubyte    0x74            
  5227. >>>>>>>>>(1.b+11)    ubyte    0xb            
  5228. >>>>>>>>>>(1.b+12)    ubyte    0x56            
  5229. >>>>>>>>>>(1.b+13)    ubyte    0xb4            \b, mkdosfs boot message display
  5230. >103    string    This\ is\ not\ a\ bootable\ disk.\     
  5231. >>132    string    Please\ insert\ a\ bootable\         
  5232. >>>157    string    floppy\ and\r\n                
  5233. >>>>169    string    press\ any\ key\ to\ try\ again...\r    \b, FREE-DOS message display
  5234. #
  5235. >66    string    Solaris\ Boot\ Sector            
  5236. >>99    string    Incomplete\ MDBoot\ load.        
  5237. >>>89    string    Version                 \b, Sun Solaris Bootloader
  5238. >>>>97    byte    x                    version %c
  5239. #
  5240. >408    string    OS/2\ !!\ SYS01475\r\0            
  5241. >>429    string    OS/2\ !!\ SYS02025\r\0            
  5242. >>>450    string    OS/2\ !!\ SYS02027\r\0            
  5243. >>>469    string    OS2BOOT\ \ \ \                 \b, IBM OS/2 Warp bootloader
  5244. #
  5245. >409    string    OS/2\ !!\ SYS01475\r\0            
  5246. >>430    string    OS/2\ !!\ SYS02025\r\0            
  5247. >>>451    string    OS/2\ !!\ SYS02027\r\0            
  5248. >>>470    string    OS2BOOT\ \ \ \                 \b, IBM OS/2 Warp Bootloader
  5249. >112        string    This\ disk\ is\ not\ bootable\r            
  5250. >>142        string    If\ you\ wish\ to\ make\ it\ bootable        
  5251. >>>176        string    run\ the\ DOS\ program\ SYS\              
  5252. >>>200        string    after\ the\r                    
  5253. >>>>216        string    system\ has\ been\ loaded\r\n            
  5254. >>>>>242    string    Please\ insert\ a\ DOS\ diskette\         
  5255. >>>>>271    string    into\r\n\ the\ drive\ and\             
  5256. >>>>>>292    string    strike\ any\ key...\0        \b, IBM OS/2 Warp message display
  5257. # XP
  5258. >430    string    NTLDR\ is\ missing\xFF\r\n        
  5259. >>449    string    Disk\ error\xFF\r\n            
  5260. >>>462    string    Press\ any\ key\ to\ restart\r        \b, Microsoft Windows XP Bootloader
  5261. # DOS names like NTLDR,CMLDR,$LDR$ are 8 right space padded bytes+3 bytes
  5262. >>>>417        ubyte&0xDF    >0            
  5263. >>>>>417    string        x            %-.5s
  5264. >>>>>>422    ubyte&0xDF    >0            
  5265. >>>>>>>422    string        x             \b%-.3s
  5266. >>>>>425    ubyte&0xDF    >0            
  5267. >>>>>>425    string        >\             \b.%-.3s
  5268. #
  5269. >>>>371        ubyte        >0x20            
  5270. >>>>>368    ubyte&0xDF    >0            
  5271. >>>>>>368    string        x             %-.5s
  5272. >>>>>>>373    ubyte&0xDF    >0            
  5273. >>>>>>>>373    string        x             \b%-.3s
  5274. >>>>>>376    ubyte&0xDF    >0            
  5275. >>>>>>>376    string        x             \b.%-.3s
  5276. #
  5277. >430    string    NTLDR\ nicht\ gefunden\xFF\r\n        
  5278. >>453    string    Datentr\204gerfehler\xFF\r\n        
  5279. >>>473    string    Neustart\ mit\ beliebiger\ Taste\r    \b, Microsoft Windows XP Bootloader (german)
  5280. >>>>417        ubyte&0xDF    >0            
  5281. >>>>>417    string        x            %-.5s
  5282. >>>>>>422    ubyte&0xDF    >0            
  5283. >>>>>>>422    string        x             \b%-.3s
  5284. >>>>>425    ubyte&0xDF    >0            
  5285. >>>>>>425    string        >\             \b.%-.3s
  5286. # offset variant
  5287. >>>>379    string    \0                    
  5288. >>>>>368    ubyte&0xDF    >0            
  5289. >>>>>>368    string        x             %-.5s
  5290. >>>>>>>373    ubyte&0xDF    >0            
  5291. >>>>>>>>373    string        x             \b%-.3s
  5292. #
  5293. >430    string    NTLDR\ fehlt\xFF\r\n            
  5294. >>444    string    Datentr\204gerfehler\xFF\r\n        
  5295. >>>464    string    Neustart\ mit\ beliebiger\ Taste\r    \b, Microsoft Windows XP Bootloader (2.german)
  5296. >>>>417        ubyte&0xDF    >0            
  5297. >>>>>417    string        x            %-.5s
  5298. >>>>>>422    ubyte&0xDF    >0            
  5299. >>>>>>>422    string        x             \b%-.3s
  5300. >>>>>425    ubyte&0xDF    >0            
  5301. >>>>>>425    string        >\             \b.%-.3s
  5302. # variant
  5303. >>>>371        ubyte        >0x20            
  5304. >>>>>368    ubyte&0xDF    >0            
  5305. >>>>>>368    string        x             %-.5s
  5306. >>>>>>>373    ubyte&0xDF    >0            
  5307. >>>>>>>>373    string        x             \b%-.3s
  5308. >>>>>>376    ubyte&0xDF    >0            
  5309. >>>>>>>376    string        x             \b.%-.3s
  5310. #
  5311. >430    string    NTLDR\ fehlt\xFF\r\n            
  5312. >>444    string    Medienfehler\xFF\r\n            
  5313. >>>459    string    Neustart:\ Taste\ dr\201cken\r        \b, Microsoft Windows XP Bootloader (3.german)
  5314. >>>>371        ubyte        >0x20            
  5315. >>>>>368    ubyte&0xDF    >0            
  5316. >>>>>>368    string        x             %-.5s
  5317. >>>>>>>373    ubyte&0xDF    >0            
  5318. >>>>>>>>373    string        x             \b%-.3s
  5319. >>>>>>376    ubyte&0xDF    >0            
  5320. >>>>>>>376    string        x             \b.%-.3s
  5321. # variant
  5322. >>>>417        ubyte&0xDF    >0            
  5323. >>>>>417    string        x            %-.5s
  5324. >>>>>>422    ubyte&0xDF    >0            
  5325. >>>>>>>422    string        x             \b%-.3s
  5326. >>>>>425    ubyte&0xDF    >0            
  5327. >>>>>>425    string        >\             \b.%-.3s
  5328. #
  5329. >430    string    Datentr\204ger\ entfernen\xFF\r\n    
  5330. >>454    string    Medienfehler\xFF\r\n            
  5331. >>>469    string    Neustart:\ Taste\ dr\201cken\r        \b, Microsoft Windows XP Bootloader (4.german)
  5332. >>>>368        ubyte&0xDF    >0            
  5333. >>>>>368    string        x             %-.5s
  5334. >>>>>>373    ubyte&0xDF    >0            
  5335. >>>>>>>373    string        x             \b%-.3s
  5336. >>>>>376    ubyte&0xDF    >0            
  5337. >>>>>>376    string        x             \b.%-.3s
  5338. #>3    string    NTFS\ \ \ \                 
  5339. >389    string    Fehler\ beim\ Lesen\ 
  5340. >>407    string    des\ Datentr\204gers
  5341. >>>426    string    NTLDR\ fehlt                
  5342. >>>>440    string    NTLDR\ ist\ komprimiert
  5343. >>>>>464 string    Neustart\ mit\ Strg+Alt+Entf\r        \b, Microsoft Windows XP Bootloader NTFS (german)
  5344. #>3    string    NTFS\ \ \ \                 
  5345. >313    string    A\ disk\ read\ error\ occurred.\r
  5346. >>345    string    A\ kernel\ file\ is\ missing\     
  5347. >>>370    string    from\ the\ disk.\r        
  5348. >>>>484    string    NTLDR\ is\ compressed        
  5349. >>>>>429 string    Insert\ a\ system\ diskette\     
  5350. >>>>>>454 string and\ restart\r\nthe\ system.\r        \b, Microsoft Windows XP Bootloader NTFS
  5351. # DOS loader variants different languages,offsets
  5352. >472    ubyte&0xDF    >0
  5353. >>389    string    Invalid\ system\ disk\xFF\r\n        
  5354. >>>411    string    Disk\ I/O\ error            
  5355. >>>>428    string    Replace\ the\ disk,\ and\         
  5356. >>>>>455 string    press\ any\ key                \b, Microsoft Windows 98 Bootloader
  5357. #IO.SYS
  5358. >>>>>>472    ubyte&0xDF    >0            
  5359. >>>>>>>472    string        x             \b %-.2s
  5360. >>>>>>>>474    ubyte&0xDF    >0            
  5361. >>>>>>>>>474    string        x             \b%-.5s
  5362. >>>>>>>>>>479    ubyte&0xDF    >0            
  5363. >>>>>>>>>>>479 string        x             \b%-.1s
  5364. >>>>>>>480    ubyte&0xDF    >0            
  5365. >>>>>>>>480    string        x             \b.%-.3s
  5366. #MSDOS.SYS
  5367. >>>>>>>483    ubyte&0xDF    >0            \b+
  5368. >>>>>>>>483    string        x             \b%-.5s
  5369. >>>>>>>>>488    ubyte&0xDF    >0            
  5370. >>>>>>>>>>488    string        x             \b%-.3s
  5371. >>>>>>>>491    ubyte&0xDF    >0            
  5372. >>>>>>>>>491    string        x             \b.%-.3s
  5373. #
  5374. >>390    string    Invalid\ system\ disk\xFF\r\n        
  5375. >>>412    string    Disk\ I/O\ error\xFF\r\n        
  5376. >>>>429    string    Replace\ the\ disk,\ and\         
  5377. >>>>>451 string    then\ press\ any\ key\r            \b, Microsoft Windows 98 Bootloader
  5378. >>388    string    Ungueltiges\ System\ \xFF\r\n        
  5379. >>>410    string    E/A-Fehler\ \ \ \ \xFF\r\n        
  5380. >>>>427    string    Datentraeger\ wechseln\ und\         
  5381. >>>>>453 string    Taste\ druecken\r            \b, Microsoft Windows 95/98/ME Bootloader (german)
  5382. #WINBOOT.SYS only not spaces (0xDF)
  5383. >>>>>>497    ubyte&0xDF    >0            
  5384. >>>>>>>497    string        x             %-.5s
  5385. >>>>>>>>502    ubyte&0xDF    >0            
  5386. >>>>>>>>>502    string        x             \b%-.1s
  5387. >>>>>>>>>>503    ubyte&0xDF    >0            
  5388. >>>>>>>>>>>503    string        x             \b%-.1s
  5389. >>>>>>>>>>>>504    ubyte&0xDF    >0            
  5390. >>>>>>>>>>>>>504 string        x             \b%-.1s
  5391. >>>>>>505    ubyte&0xDF    >0            
  5392. >>>>>>>505    string        x             \b.%-.3s
  5393. #IO.SYS
  5394. >>>>>>472    ubyte&0xDF    >0            or
  5395. >>>>>>>472    string        x             \b %-.2s
  5396. >>>>>>>>474    ubyte&0xDF    >0            
  5397. >>>>>>>>>474    string        x             \b%-.5s
  5398. >>>>>>>>>>479    ubyte&0xDF    >0            
  5399. >>>>>>>>>>>479 string        x             \b%-.1s
  5400. >>>>>>>480    ubyte&0xDF    >0            
  5401. >>>>>>>>480    string        x             \b.%-.3s
  5402. #MSDOS.SYS
  5403. >>>>>>>483    ubyte&0xDF    >0            \b+
  5404. >>>>>>>>483    string        x             \b%-.5s
  5405. >>>>>>>>>488    ubyte&0xDF    >0            
  5406. >>>>>>>>>>488    string        x             \b%-.3s
  5407. >>>>>>>>491    ubyte&0xDF    >0            
  5408. >>>>>>>>>491    string        x             \b.%-.3s
  5409. #
  5410. >>390    string    Ungueltiges\ System\ \xFF\r\n        
  5411. >>>412    string    E/A-Fehler\ \ \ \ \xFF\r\n        
  5412. >>>>429    string    Datentraeger\ wechseln\ und\         
  5413. >>>>>455 string    Taste\ druecken\r            \b, Microsoft Windows 95/98/ME Bootloader (German)
  5414. #WINBOOT.SYS only not spaces (0xDF)
  5415. >>>>>>497    ubyte&0xDF    >0            
  5416. >>>>>>>497    string        x             %-.7s
  5417. >>>>>>>>504    ubyte&0xDF    >0            
  5418. >>>>>>>>>504    string        x             \b%-.1s
  5419. >>>>>>505    ubyte&0xDF    >0            
  5420. >>>>>>>505    string        x             \b.%-.3s
  5421. #IO.SYS
  5422. >>>>>>472    ubyte&0xDF    >0            or
  5423. >>>>>>>472    string        x             \b %-.2s
  5424. >>>>>>>>474    ubyte&0xDF    >0            
  5425. >>>>>>>>>474    string        x             \b%-.6s
  5426. >>>>>>>480    ubyte&0xDF    >0            
  5427. >>>>>>>>480    string        x             \b.%-.3s
  5428. #MSDOS.SYS
  5429. >>>>>>>483    ubyte&0xDF    >0            \b+
  5430. >>>>>>>>483    string        x             \b%-.5s
  5431. >>>>>>>>>488    ubyte&0xDF    >0            
  5432. >>>>>>>>>>488    string        x             \b%-.3s
  5433. >>>>>>>>491    ubyte&0xDF    >0            
  5434. >>>>>>>>>491    string        x             \b.%-.3s
  5435. #
  5436. >>389    string    Ungueltiges\ System\ \xFF\r\n        
  5437. >>>411    string    E/A-Fehler\ \ \ \ \xFF\r\n        
  5438. >>>>428    string    Datentraeger\ wechseln\ und\         
  5439. >>>>>454 string    Taste\ druecken\r            \b, Microsoft Windows 95/98/ME Bootloader (GERMAN)
  5440. # DOS names like IO.SYS,WINBOOT.SYS,MSDOS.SYS,WINBOOT.INI are 8 right space padded bytes+3 bytes
  5441. >>>>>>472    string        x             %-.2s
  5442. >>>>>>>474    ubyte&0xDF    >0            
  5443. >>>>>>>>474    string        x             \b%-.5s
  5444. >>>>>>>>479    ubyte&0xDF    >0            
  5445. >>>>>>>>>479    string        x             \b%-.1s
  5446. >>>>>>480    ubyte&0xDF    >0            
  5447. >>>>>>>480    string        x             \b.%-.3s
  5448. >>>>>>483    ubyte&0xDF    >0            \b+
  5449. >>>>>>>483    string        x             \b%-.5s
  5450. >>>>>>>488    ubyte&0xDF    >0            
  5451. >>>>>>>>488    string        x             \b%-.2s
  5452. >>>>>>>>490    ubyte&0xDF    >0            
  5453. >>>>>>>>>490    string        x             \b%-.1s
  5454. >>>>>>>491    ubyte&0xDF    >0            
  5455. >>>>>>>>491    string        x             \b.%-.3s
  5456. >479    ubyte&0xDF    >0
  5457. >>416    string    Kein\ System\ oder\             
  5458. >>>433    string    Laufwerksfehler                
  5459. >>>>450    string    Wechseln\ und\ Taste\ dr\201cken    \b, Microsoft DOS Bootloader (german)
  5460. #IO.SYS
  5461. >>>>>479    string        x             \b %-.2s
  5462. >>>>>>481    ubyte&0xDF    >0            
  5463. >>>>>>>481    string        x             \b%-.6s
  5464. >>>>>487    ubyte&0xDF    >0            
  5465. >>>>>>487    string        x             \b.%-.3s
  5466. #MSDOS.SYS
  5467. >>>>>>490    ubyte&0xDF    >0            \b+
  5468. >>>>>>>490    string        x             \b%-.5s
  5469. >>>>>>>>495    ubyte&0xDF    >0            
  5470. >>>>>>>>>495    string        x             \b%-.3s
  5471. >>>>>>>498    ubyte&0xDF    >0            
  5472. >>>>>>>>498    string        x             \b.%-.3s
  5473. #
  5474. >376    search/41    Non-System\ disk\ or\         
  5475. >>395    search/41    disk\ error\r            
  5476. >>>407    search/41    Replace\ and\             
  5477. >>>>419    search/41    press\                 \b,
  5478. >>>>419    search/41    strike\             \b, old
  5479. >>>>426    search/41    any\ key\ when\ ready\r        MS or PC-DOS bootloader
  5480. #449            Disk\ Boot\ failure\r        MS 3.21
  5481. #466            Boot\ Failure\r            MS 3.30
  5482. >>>>>468 search/18    \0                
  5483. #IO.SYS,IBMBIO.COM
  5484. >>>>>>&0    string        x             \b %-.2s
  5485. >>>>>>>&-20    ubyte&0xDF    >0            
  5486. >>>>>>>>&-1    string        x             \b%-.4s
  5487. >>>>>>>>>&-16    ubyte&0xDF    >0            
  5488. >>>>>>>>>>&-1    string        x             \b%-.2s
  5489. >>>>>>&8    ubyte&0xDF    >0            \b.
  5490. >>>>>>>&-1    string        x             \b%-.3s
  5491. #MSDOS.SYS,IBMDOS.COM
  5492. >>>>>>&11    ubyte&0xDF    >0            \b+
  5493. >>>>>>>&-1    string        x             \b%-.5s
  5494. >>>>>>>>&-6    ubyte&0xDF    >0            
  5495. >>>>>>>>>&-1    string        x             \b%-.1s
  5496. >>>>>>>>>>&-5    ubyte&0xDF    >0            
  5497. >>>>>>>>>>>&-1    string        x             \b%-.2s
  5498. >>>>>>>&7    ubyte&0xDF    >0            \b.
  5499. >>>>>>>>&-1    string        x             \b%-.3s
  5500. >441    string    Cannot\ load\ from\ harddisk.\n\r
  5501. >>469    string    Insert\ Systemdisk\             
  5502. >>>487    string    and\ press\ any\ key.\n\r        \b, MS (2.11) DOS bootloader
  5503. #>43    string    \224R-LOADER\ \ SYS            =label                    
  5504. >54    string    SYS
  5505. >>324    string    VASKK
  5506. >>>495    string    NEWLDR\0                \b, DR-DOS Bootloader (LOADER.SYS)
  5507. #
  5508. >98    string    Press\ a\ key\ to\ retry\0\r        
  5509. >>120    string    Cannot\ find\ file\ \0\r        
  5510. >>>139    string    Disk\ read\ error\0\r            
  5511. >>>>156    string    Loading\ ...\0                \b, DR-DOS (3.41) Bootloader
  5512. #DRBIOS.SYS
  5513. >>>>>44        ubyte&0xDF    >0            
  5514. >>>>>>44    string        x            \b %-.6s
  5515. >>>>>>>50    ubyte&0xDF    >0            
  5516. >>>>>>>>50    string        x             \b%-.2s
  5517. >>>>>>52    ubyte&0xDF    >0            
  5518. >>>>>>>52    string        x             \b.%-.3s
  5519. #
  5520. >70    string    IBMBIO\ \ COM                
  5521. >>472    string    Cannot\ load\ DOS!\             
  5522. >>>489    string    Any\ key\ to\ retry            \b, DR-DOS Bootloader
  5523. >>471    string    Cannot\ load\ DOS\             
  5524. >>487    string    press\ key\ to\ retry            \b, Open-DOS Bootloader
  5525. >444    string    KERNEL\ \ SYS                    
  5526. >>314    string    BOOT\ error!                \b, FREE-DOS Bootloader
  5527. >499    string    KERNEL\ \ SYS                
  5528. >>305    string    BOOT\ err!\0                \b, Free-DOS Bootloader
  5529. >449    string    KERNEL\ \ SYS                
  5530. >>319    string    BOOT\ error!                \b, FREE-DOS 0.5 Bootloader
  5531. >125    string    Loading\ FreeDOS...\r            
  5532. >>311    string    BOOT\ error!\r                \b, FREE-DOS bootloader
  5533. >>>441        ubyte&0xDF    >0            
  5534. >>>>441        string        x             \b %-.6s
  5535. >>>>>447    ubyte&0xDF    >0            
  5536. >>>>>>447    string        x             \b%-.1s
  5537. >>>>>>>448    ubyte&0xDF    >0            
  5538. >>>>>>>>448    string        x             \b%-.1s
  5539. >>>>449        ubyte&0xDF    >0            
  5540. >>>>>449    string        x             \b.%-.3s
  5541. >124    string    FreeDOS\0                
  5542. >>331    string    \ err\0                    \b, FREE-DOS BETa 0.9 Bootloader
  5543. # DOS names like KERNEL.SYS,KERNEL16.SYS,KERNEL32.SYS,METAKERN.SYS are 8 right space padded bytes+3 bytes
  5544. >>>497        ubyte&0xDF    >0            
  5545. >>>>497        string        x             \b %-.6s
  5546. >>>>>503    ubyte&0xDF    >0            
  5547. >>>>>>503    string        x             \b%-.1s
  5548. >>>>>>>504    ubyte&0xDF    >0            
  5549. >>>>>>>>504    string        x             \b%-.1s
  5550. >>>>505        ubyte&0xDF    >0            
  5551. >>>>>505    string        x             \b.%-.3s
  5552. >>333    string    \ err\0                    \b, FREE-DOS BEta 0.9 Bootloader
  5553. >>>497        ubyte&0xDF    >0            
  5554. >>>>497        string        x             \b %-.6s
  5555. >>>>>503    ubyte&0xDF    >0            
  5556. >>>>>>503    string        x             \b%-.1s
  5557. >>>>>>>504    ubyte&0xDF    >0            
  5558. >>>>>>>>504    string        x             \b%-.1s
  5559. >>>>505        ubyte&0xDF    >0            
  5560. >>>>>505    string        x             \b.%-.3s
  5561. >>334    string    \ err\0                    \b, FREE-DOS Beta 0.9 Bootloader
  5562. >>>497        ubyte&0xDF    >0            
  5563. >>>>497        string        x             \b %-.6s
  5564. >>>>>503    ubyte&0xDF    >0            
  5565. >>>>>>503    string        x             \b%-.1s
  5566. >>>>>>>504    ubyte&0xDF    >0            
  5567. >>>>>>>>504    string        x             \b%-.1s
  5568. >>>>505        ubyte&0xDF    >0            
  5569. >>>>>505    string        x             \b.%-.3s
  5570. >336    string    Error!\                 
  5571. >>343    string    Hit\ a\ key\ to\ reboot.        \b, FREE-DOS Beta 0.9sr1 Bootloader
  5572. >>>497        ubyte&0xDF    >0            
  5573. >>>>497        string        x             \b %-.6s
  5574. >>>>>503    ubyte&0xDF    >0            
  5575. >>>>>>503    string        x             \b%-.1s
  5576. >>>>>>>504    ubyte&0xDF    >0            
  5577. >>>>>>>>504    string        x             \b%-.1s
  5578. >>>>505        ubyte&0xDF    >0            
  5579. >>>>>505    string        x             \b.%-.3s
  5580. # added by Joerg Jenderek
  5581. # http://www.visopsys.org/
  5582. # http://partitionlogic.org.uk/
  5583. # OEM-ID=Visopsys
  5584. >478        ulelong    0                    
  5585. >>(1.b+326)    string    I/O\ Error\ reading\             
  5586. >>>(1.b+344)    string    Visopsys\ loader\r            
  5587. >>>>(1.b+361)    string    Press\ any\ key\ to\ continue.\r    \b, Visopsys loader
  5588. # http://alexfru.chat.ru/epm.html#bootprog
  5589. >494    ubyte    >0x4D                    
  5590. >>495    string    >E                    
  5591. >>>495    string    <S                    
  5592. #OEM-ID is not reliable
  5593. >>>>3    string    BootProg                
  5594. # It just looks for a program file name at the root directory
  5595. # and loads corresponding file with following execution.
  5596. # DOS names like STARTUP.BIN,STARTUPC.COM,STARTUPE.EXE are 8 right space padded bytes+3 bytes
  5597. >>>>499            ubyte&0xDF    >0        \b, COM/EXE Bootloader
  5598. >>>>>499        string        x         \b %-.1s
  5599. >>>>>>500        ubyte&0xDF    >0        
  5600. >>>>>>>500        string        x         \b%-.1s
  5601. >>>>>>>>501        ubyte&0xDF    >0        
  5602. >>>>>>>>>501        string        x         \b%-.1s
  5603. >>>>>>>>>>502        ubyte&0xDF    >0        
  5604. >>>>>>>>>>>502        string        x         \b%-.1s
  5605. >>>>>>>>>>>>503        ubyte&0xDF    >0        
  5606. >>>>>>>>>>>>>503    string        x         \b%-.1s
  5607. >>>>>>>>>>>>>>504    ubyte&0xDF    >0        
  5608. >>>>>>>>>>>>>>>504    string        x         \b%-.1s
  5609. >>>>>>>>>>>>>>>>505    ubyte&0xDF    >0        
  5610. >>>>>>>>>>>>>>>>>505    string        x         \b%-.1s
  5611. >>>>>>>>>>>>>>>>>>506    ubyte&0xDF    >0        
  5612. >>>>>>>>>>>>>>>>>>>506    string        x         \b%-.1s
  5613. #name extension
  5614. >>>>>507        ubyte&0xDF    >0        \b.
  5615. >>>>>>507        string        x         \b%-.1s
  5616. >>>>>>>508        ubyte&0xDF    >0        
  5617. >>>>>>>>508        string        x         \b%-.1s
  5618. >>>>>>>>>509        ubyte&0xDF    >0        
  5619. >>>>>>>>>>509        string        x         \b%-.1s
  5620. #If the boot sector fails to read any other sector,
  5621. #it prints a very short message ("RE") to the screen and hangs the computer.
  5622. #If the boot sector fails to find needed program in the root directory,
  5623. #it also hangs with another message ("NF").
  5624. >>>>>492        string        RENF        \b, FAT (12 bit)
  5625. >>>>>495        string        RENF        \b, FAT (16 bit)
  5626. # http://alexfru.chat.ru/epm.html#bootprog
  5627. >494    ubyte    >0x4D                    
  5628. >>495    string    >E                    
  5629. >>>495    string    <S                    
  5630. #OEM-ID is not reliable
  5631. >>>>3    string    BootProg                
  5632. # It just looks for a program file name at the root directory
  5633. # and loads corresponding file with following execution.
  5634. # DOS names like STARTUP.BIN,STARTUPC.COM,STARTUPE.EXE are 8 right space padded bytes+3 bytes
  5635. >>>>499            ubyte&0xDF    >0        \b, COM/EXE Bootloader
  5636. >>>>>499        string        x         \b %-.1s
  5637. >>>>>>500        ubyte&0xDF    >0        
  5638. >>>>>>>500        string        x         \b%-.1s
  5639. >>>>>>>>501        ubyte&0xDF    >0        
  5640. >>>>>>>>>501        string        x         \b%-.1s
  5641. >>>>>>>>>>502        ubyte&0xDF    >0        
  5642. >>>>>>>>>>>502        string        x         \b%-.1s
  5643. >>>>>>>>>>>>503        ubyte&0xDF    >0        
  5644. >>>>>>>>>>>>>503    string        x         \b%-.1s
  5645. >>>>>>>>>>>>>>504    ubyte&0xDF    >0        
  5646. >>>>>>>>>>>>>>>504    string        x         \b%-.1s
  5647. >>>>>>>>>>>>>>>>505    ubyte&0xDF    >0        
  5648. >>>>>>>>>>>>>>>>>505    string        x         \b%-.1s
  5649. >>>>>>>>>>>>>>>>>>506    ubyte&0xDF    >0        
  5650. >>>>>>>>>>>>>>>>>>>506    string        x         \b%-.1s
  5651. #name extension
  5652. >>>>>507        ubyte&0xDF    >0        \b.
  5653. >>>>>>507        string        x         \b%-.1s
  5654. >>>>>>>508        ubyte&0xDF    >0        
  5655. >>>>>>>>508        string        x         \b%-.1s
  5656. >>>>>>>>>509        ubyte&0xDF    >0        
  5657. >>>>>>>>>>509        string        x         \b%-.1s
  5658. #If the boot sector fails to read any other sector,
  5659. #it prints a very short message ("RE") to the screen and hangs the computer.
  5660. #If the boot sector fails to find needed program in the root directory,
  5661. #it also hangs with another message ("NF").
  5662. >>>>>492        string        RENF        \b, FAT (12 bit)
  5663. >>>>>495        string        RENF        \b, FAT (16 bit)
  5664. # added by Joerg Jenderek
  5665. # http://syslinux.zytor.com/iso.php
  5666. 0    ulelong    0x7c40eafa        isolinux Loader
  5667. # http://syslinux.zytor.com/pxe.php
  5668. 0    ulelong    0x007c05ea        pxelinux Loader
  5669. 0    ulelong    0x60669c66        pxelinux Loader
  5670. # loader end
  5671. # updated by Joerg Jenderek at Sep 2007
  5672. >3    ubyte    0            
  5673. #no active flag
  5674. >>446    ubyte    0            
  5675. # partition 1 not empty
  5676. >>>450    ubyte    >0            
  5677. # partitions 3,4 empty
  5678. >>>>482        ubyte    0            
  5679. >>>>>498    ubyte    0            
  5680. # partition 2 ID=0,5,15
  5681. >>>>>>466    ubyte    <0x10            
  5682. >>>>>>>466    ubyte    0x05            \b, extended partition table
  5683. >>>>>>>466    ubyte    0x0F            \b, extended partition table (LBA)
  5684. >>>>>>>466    ubyte    0x0            \b, extended partition table (last)    
  5685. # JuMP short     bootcodeoffset NOP assembler instructions will usually be EB xx 90
  5686. # http://mirror.href.com/thestarman/asm/2bytejumps.htmm#FWD
  5687. # older drives may use Near JuMP instruction E9 xx xx
  5688. >0        lelong&0x009000EB    0x009000EB 
  5689. >0        lelong&0x000000E9    0x000000E9 
  5690. # maximal short forward jump is 07fx
  5691. >1        ubyte            <0xff    \b, code offset 0x%x
  5692. # mtools-3.9.8/msdos.h
  5693. # usual values are marked with comments to get only informations of strange FAT systems
  5694. # valid sectorsize must be a power of 2 from 32 to 32768
  5695. >>11        uleshort&0x000f    x        
  5696. >>>11        uleshort    <32769        
  5697. >>>>11        uleshort    >31        
  5698. >>>>>3        string        >\0        \b, OEM-ID "%8.8s"
  5699. #http://mirror.href.com/thestarman/asm/debug/debug2.htm#IHC
  5700. >>>>>>8        string        IHC        \b cached by Windows 9M
  5701. >>>>>11        uleshort    >512        \b, Bytes/sector %u
  5702. #>>>>>11    uleshort    =512        \b, Bytes/sector %u=512 (usual)
  5703. >>>>>11        uleshort    <512        \b, Bytes/sector %u
  5704. >>>>>13        ubyte        >1        \b, sectors/cluster %u
  5705. #>>>>>13    ubyte        =1        \b, sectors/cluster %u (usual on Floppies)
  5706. >>>>>14        uleshort    >32        \b, reserved sectors %u
  5707. #>>>>>14    uleshort    =32        \b, reserved sectors %u (usual Fat32)
  5708. #>>>>>14    uleshort    >1        \b, reserved sectors %u
  5709. #>>>>>14    uleshort    =1        \b, reserved sectors %u (usual FAT12,FAT16)
  5710. >>>>>14        uleshort    <1        \b, reserved sectors %u
  5711. >>>>>16        ubyte        >2        \b, FATs %u
  5712. #>>>>>16    ubyte        =2        \b, FATs %u (usual)
  5713. >>>>>16        ubyte        =1        \b, FAT  %u
  5714. >>>>>16        ubyte        >0
  5715. >>>>>17        uleshort    >0        \b, root entries %u
  5716. #>>>>>17    uleshort    =0        \b, root entries %u=0 (usual Fat32)
  5717. >>>>>19        uleshort    >0        \b, sectors %u (volumes <=32 MB) 
  5718. #>>>>>19    uleshort    =0        \b, sectors %u=0 (usual Fat32)
  5719. >>>>>21        ubyte        >0xF0        \b, Media descriptor 0x%x
  5720. #>>>>>21    ubyte        =0xF0        \b, Media descriptor 0x%x (usual floppy)
  5721. >>>>>21        ubyte        <0xF0        \b, Media descriptor 0x%x
  5722. >>>>>22        uleshort    >0        \b, sectors/FAT %u
  5723. #>>>>>22    uleshort    =0        \b, sectors/FAT %u=0 (usual Fat32)
  5724. >>>>>26        ubyte        >2        \b, heads %u
  5725. #>>>>>26    ubyte        =2        \b, heads %u (usual floppy)
  5726. >>>>>26        ubyte        =1        \b, heads %u
  5727. #skip for Digital Research DOS (version 3.41) 1440 kB Bootdisk
  5728. >>>>>38        ubyte        !0x70        
  5729. >>>>>>28    ulelong        >0        \b, hidden sectors %u
  5730. #>>>>>>28    ulelong        =0        \b, hidden sectors %u (usual floppy)
  5731. >>>>>>32    ulelong        >0        \b, sectors %u (volumes > 32 MB) 
  5732. #>>>>>>32    ulelong        =0        \b, sectors %u (volumes > 32 MB)
  5733. # FAT<32 specific 
  5734. >>>>>82        string        !FAT32
  5735. #>>>>>>36    ubyte        0x80        \b, physical drive 0x%x=0x80 (usual harddisk)
  5736. #>>>>>>36    ubyte        0        \b, physical drive 0x%x=0 (usual floppy)
  5737. >>>>>>36    ubyte        !0x80        
  5738. >>>>>>>36    ubyte        !0        \b, physical drive 0x%x
  5739. >>>>>>37    ubyte        >0        \b, reserved 0x%x
  5740. #>>>>>>37    ubyte        =0        \b, reserved 0x%x
  5741. >>>>>>38    ubyte        >0x29        \b, dos < 4.0 BootSector (0x%x)
  5742. >>>>>>38    ubyte        <0x29        \b, dos < 4.0 BootSector (0x%x)
  5743. >>>>>>38    ubyte        =0x29
  5744. >>>>>>>39    ulelong        x        \b, serial number 0x%x
  5745. >>>>>>>43    string        <NO\ NAME    \b, label: "%11.11s"
  5746. >>>>>>>43    string        >NO\ NAME    \b, label: "%11.11s"
  5747. >>>>>>>43    string        =NO\ NAME    \b, unlabeled
  5748. >>>>>>54    string        FAT        \b, FAT
  5749. >>>>>>>54    string        FAT12        \b (12 bit)
  5750. >>>>>>>54    string        FAT16        \b (16 bit)
  5751. # FAT32 specific
  5752. >>>>>82        string        FAT32        \b, FAT (32 bit)
  5753. >>>>>>36    ulelong        x        \b, sectors/FAT %u
  5754. >>>>>>40    uleshort    >0        \b, extension flags %u
  5755. #>>>>>>40    uleshort    =0        \b, extension flags %u
  5756. >>>>>>42    uleshort    >0        \b, fsVersion %u
  5757. #>>>>>>42    uleshort    =0        \b, fsVersion %u (usual)
  5758. >>>>>>44    ulelong        >2        \b, rootdir cluster %u
  5759. #>>>>>>44    ulelong        =2        \b, rootdir cluster %u
  5760. #>>>>>>44    ulelong        =1        \b, rootdir cluster %u
  5761. >>>>>>48    uleshort    >1        \b, infoSector %u
  5762. #>>>>>>48    uleshort    =1        \b, infoSector %u (usual)
  5763. >>>>>>48    uleshort    <1        \b, infoSector %u
  5764. >>>>>>50    uleshort    >6        \b, Backup boot sector %u
  5765. #>>>>>>50    uleshort    =6        \b, Backup boot sector %u (usual) 
  5766. >>>>>>50    uleshort    <6        \b, Backup boot sector %u
  5767. >>>>>>54    ulelong        >0        \b, reserved1 0x%x
  5768. >>>>>>58    ulelong        >0        \b, reserved2 0x%x
  5769. >>>>>>62    ulelong        >0        \b, reserved3 0x%x
  5770. # same structure as FAT1X 
  5771. >>>>>>64    ubyte        >0x80        \b, physical drive 0x%x
  5772. #>>>>>>64    ubyte        =0x80        \b, physical drive 0x%x=80 (usual harddisk)
  5773. >>>>>>64    ubyte&0x7F    >0        \b, physical drive 0x%x
  5774. #>>>>>>64    ubyte        =0        \b, physical drive 0x%x=0 (usual floppy)
  5775. >>>>>>65    ubyte        >0        \b, reserved 0x%x
  5776. >>>>>>66    ubyte        >0x29        \b, dos < 4.0 BootSector (0x%x)
  5777. >>>>>>66    ubyte        <0x29        \b, dos < 4.0 BootSector (0x%x)
  5778. >>>>>>66    ubyte        =0x29
  5779. >>>>>>>67    ulelong        x        \b, serial number 0x%x
  5780. >>>>>>>71    string        <NO\ NAME    \b, label: "%11.11s"
  5781. >>>>>>71    string        >NO\ NAME    \b, label: "%11.11s"
  5782. >>>>>>71    string        =NO\ NAME    \b, unlabeled
  5783. ### FATs end
  5784. >0x200    lelong    0x82564557        \b, BSD disklabel
  5785. # FATX 
  5786. 0        string        FATX        FATX filesystem data
  5787.  
  5788.  
  5789. # Minix filesystems - Juan Cespedes <cespedes@debian.org>
  5790. 0x410    leshort        0x137f        Minix filesystem
  5791. 0x410    beshort        0x137f        Minix filesystem (big endian)
  5792. >0x402    beshort        !0        \b, %d zones
  5793. >0x1e    string        minix        \b, bootable
  5794. 0x410    leshort        0x138f        Minix filesystem, 30 char names
  5795. 0x410    leshort        0x2468        Minix filesystem, version 2
  5796. 0x410    leshort        0x2478        Minix filesystem, version 2, 30 char names
  5797.  
  5798. # romfs filesystems - Juan Cespedes <cespedes@debian.org>
  5799. 0    string        -rom1fs-\0    romfs filesystem, version 1
  5800. >8    belong    x            %d bytes,
  5801. >16    string    x            named %s.
  5802.  
  5803. # netboot image - Juan Cespedes <cespedes@debian.org>
  5804. 0    lelong        0x1b031336L    Netboot image,
  5805. >4    lelong&0xFFFFFF00    0
  5806. >>4    lelong&0x100    0x000        mode 2
  5807. >>4    lelong&0x100    0x100        mode 3
  5808. >4    lelong&0xFFFFFF00    !0    unknown mode
  5809.  
  5810. 0x18b    string    OS/2    OS/2 Boot Manager
  5811.  
  5812. # added by Joerg Jenderek
  5813. # In the second sector (+0x200) are variables according to grub-0.97/stage2/asm.S or
  5814. # grub-1.94/kern/i386/pc/startup.S
  5815. # http://www.gnu.org/software/grub/manual/grub.html#Embedded-data
  5816. # usual values are marked with comments to get only informations of strange GRUB loaders
  5817. 0x200    uleshort        0x70EA        
  5818. # found only version 3.{1,2}
  5819. >0x206        ubeshort    >0x0300        
  5820. # GRUB version (0.5.)95,0.93,0.94,0.96,0.97 > "00"
  5821. >>0x212     ubyte        >0x29        
  5822. >>>0x213     ubyte        >0x29        
  5823. # not iso9660_stage1_5
  5824. #>>>0    ulelong&0x00BE5652    0x00BE5652    
  5825. >>>>0x213     ubyte        >0x29        GRand Unified Bootloader
  5826. # config_file for stage1_5 is 0xffffffff + default "/boot/grub/stage2"
  5827. >>>>0x217     ubyte        0xFF        stage1_5
  5828. >>>>0x217     ubyte        <0xFF        stage2
  5829. >>>>0x206    ubyte        x        \b version %u
  5830. >>>>0x207    ubyte        x        \b.%u
  5831. # module_size for 1.94
  5832. >>>>0x208    ulelong        <0xffffff    \b, installed partition %u
  5833. #>>>>0x208    ulelong        =0xffffff    \b, %u (default)
  5834. >>>>0x208    ulelong        >0xffffff    \b, installed partition %u
  5835. # GRUB 0.5.95 unofficial
  5836. >>>>0x20C    ulelong&0x2E300000 0x2E300000    
  5837. # 0=stage2    1=ffs    2=e2fs    3=fat    4=minix    5=reiserfs
  5838. >>>>>0x20C    ubyte        x        \b, identifier 0x%x
  5839. #>>>>>0x20D    ubyte        =0        \b, LBA flag 0x%x (default)
  5840. >>>>>0x20D    ubyte        >0        \b, LBA flag 0x%x
  5841. # GRUB version as string
  5842. >>>>>0x20E     string        >\0        \b, GRUB version %-s
  5843. # for stage1_5 is 0xffffffff + config_file "/boot/grub/stage2" default
  5844. >>>>>>0x215     ulong        0xffffffff    
  5845. >>>>>>>0x219     string        >\0        \b, configuration file %-s
  5846. >>>>>>0x215     ulong        !0xffffffff    
  5847. >>>>>>>0x215     string        >\0        \b, configuration file %-s
  5848. # newer GRUB versions
  5849. >>>>0x20C    ulelong&0x2E300000 !0x2E300000    
  5850. ##>>>>>0x20C    ulelong        =0        \b, saved entry %d (usual)
  5851. >>>>>0x20C    ulelong        >0        \b, saved entry %d
  5852. # for 1.94 contains kernel image size
  5853. # for 0.93,0.94,0.96,0.97
  5854. # 0=stage2    1=ffs    2=e2fs    3=fat    4=minix    5=reiserfs    6=vstafs    7=jfs    8=xfs    9=iso9660    a=ufs2    
  5855. >>>>>0x210    ubyte        x        \b, identifier 0x%x
  5856. # The flag for LBA forcing is in most cases 0
  5857. #>>>>>0x211    ubyte        =0        \b, LBA flag 0x%x (default)
  5858. >>>>>0x211    ubyte        >0        \b, LBA flag 0x%x
  5859. # GRUB version as string
  5860. >>>>>0x212     string        >\0        \b, GRUB version %-s
  5861. # for stage1_5 is 0xffffffff + config_file "/boot/grub/stage2" default
  5862. >>>>>0x217     ulong        0xffffffff    
  5863. >>>>>>0x21b     string        >\0        \b, configuration file %-s
  5864. >>>>>0x217     ulong        !0xffffffff    
  5865. >>>>>>0x217     string        >\0        \b, configuration file %-s
  5866.  
  5867. 9564    lelong        0x00011954    Unix Fast File system [v1] (little-endian),
  5868. >8404    string        x        last mounted on %s,
  5869. #>9504    ledate        x        last checked at %s,
  5870. >8224    ledate        x        last written at %s,
  5871. >8401    byte        x        clean flag %d,
  5872. >8228    lelong        x        number of blocks %d,
  5873. >8232    lelong        x        number of data blocks %d,
  5874. >8236    lelong        x        number of cylinder groups %d,
  5875. >8240    lelong        x        block size %d,
  5876. >8244    lelong        x        fragment size %d,
  5877. >8252    lelong        x        minimum percentage of free blocks %d,
  5878. >8256    lelong        x        rotational delay %dms,
  5879. >8260    lelong        x        disk rotational speed %drps,
  5880. >8320    lelong        0        TIME optimization
  5881. >8320    lelong        1        SPACE optimization
  5882.  
  5883. 42332    lelong        0x19540119    Unix Fast File system [v2] (little-endian)
  5884. >&-1164    string        x        last mounted on %s,
  5885. >&-696    string        >\0        volume name %s,
  5886. >&-304    leqldate    x        last written at %s,
  5887. >&-1167    byte        x        clean flag %d,
  5888. >&-1168    byte        x        readonly flag %d,
  5889. >&-296    lequad        x        number of blocks %lld,
  5890. >&-288    lequad        x        number of data blocks %lld,
  5891. >&-1332    lelong        x        number of cylinder groups %d,
  5892. >&-1328    lelong        x        block size %d,
  5893. >&-1324    lelong        x        fragment size %d,
  5894. >&-180    lelong        x        average file size %d,
  5895. >&-176    lelong        x        average number of files in dir %d,
  5896. >&-272    lequad        x        pending blocks to free %lld,
  5897. >&-264    lelong        x        pending inodes to free %ld,
  5898. >&-664    lequad        x        system-wide uuid %0llx,
  5899. >&-1316    lelong        x        minimum percentage of free blocks %d,
  5900. >&-1248    lelong        0        TIME optimization
  5901. >&-1248    lelong        1        SPACE optimization
  5902.  
  5903. 66908    lelong        0x19540119    Unix Fast File system [v2] (little-endian)
  5904. >&-1164    string        x        last mounted on %s,
  5905. >&-696    string        >\0        volume name %s,
  5906. >&-304    leqldate    x        last written at %s,
  5907. >&-1167    byte        x        clean flag %d,
  5908. >&-1168    byte        x        readonly flag %d,
  5909. >&-296    lequad        x        number of blocks %lld,
  5910. >&-288    lequad        x        number of data blocks %lld,
  5911. >&-1332    lelong        x        number of cylinder groups %d,
  5912. >&-1328    lelong        x        block size %d,
  5913. >&-1324    lelong        x        fragment size %d,
  5914. >&-180    lelong        x        average file size %d,
  5915. >&-176    lelong        x        average number of files in dir %d,
  5916. >&-272    lequad        x        pending blocks to free %lld,
  5917. >&-264    lelong        x        pending inodes to free %ld,
  5918. >&-664    lequad        x        system-wide uuid %0llx,
  5919. >&-1316    lelong        x        minimum percentage of free blocks %d,
  5920. >&-1248    lelong        0        TIME optimization
  5921. >&-1248    lelong        1        SPACE optimization
  5922.  
  5923. 9564    belong        0x00011954    Unix Fast File system [v1] (big-endian),
  5924. >7168   belong        0x4c41424c    Apple UFS Volume
  5925. >>7186  string        x        named %s,
  5926. >>7176  belong        x        volume label version %d,
  5927. >>7180  bedate        x        created on %s,
  5928. >8404    string        x        last mounted on %s,
  5929. #>9504    bedate        x        last checked at %s,
  5930. >8224    bedate        x        last written at %s,
  5931. >8401    byte        x        clean flag %d,
  5932. >8228    belong        x        number of blocks %d,
  5933. >8232    belong        x        number of data blocks %d,
  5934. >8236    belong        x        number of cylinder groups %d,
  5935. >8240    belong        x        block size %d,
  5936. >8244    belong        x        fragment size %d,
  5937. >8252    belong        x        minimum percentage of free blocks %d,
  5938. >8256    belong        x        rotational delay %dms,
  5939. >8260    belong        x        disk rotational speed %drps,
  5940. >8320    belong        0        TIME optimization
  5941. >8320    belong        1        SPACE optimization
  5942.  
  5943. 42332    belong        0x19540119    Unix Fast File system [v2] (big-endian)
  5944. >&-1164    string        x        last mounted on %s,
  5945. >&-696    string        >\0        volume name %s,
  5946. >&-304    beqldate    x        last written at %s,
  5947. >&-1167    byte        x        clean flag %d,
  5948. >&-1168    byte        x        readonly flag %d,
  5949. >&-296    bequad        x        number of blocks %lld,
  5950. >&-288    bequad        x        number of data blocks %lld,
  5951. >&-1332    belong        x        number of cylinder groups %d,
  5952. >&-1328    belong        x        block size %d,
  5953. >&-1324    belong        x        fragment size %d,
  5954. >&-180    belong        x        average file size %d,
  5955. >&-176    belong        x        average number of files in dir %d,
  5956. >&-272    bequad        x        pending blocks to free %lld,
  5957. >&-264    belong        x        pending inodes to free %ld,
  5958. >&-664    bequad        x        system-wide uuid %0llx,
  5959. >&-1316    belong        x        minimum percentage of free blocks %d,
  5960. >&-1248    belong        0        TIME optimization
  5961. >&-1248    belong        1        SPACE optimization
  5962.  
  5963. 66908    belong        0x19540119    Unix Fast File system [v2] (big-endian)
  5964. >&-1164    string        x        last mounted on %s,
  5965. >&-696    string        >\0        volume name %s,
  5966. >&-304    beqldate    x        last written at %s,
  5967. >&-1167    byte        x        clean flag %d,
  5968. >&-1168    byte        x        readonly flag %d,
  5969. >&-296    bequad        x        number of blocks %lld,
  5970. >&-288    bequad        x        number of data blocks %lld,
  5971. >&-1332    belong        x        number of cylinder groups %d,
  5972. >&-1328    belong        x        block size %d,
  5973. >&-1324    belong        x        fragment size %d,
  5974. >&-180    belong        x        average file size %d,
  5975. >&-176    belong        x        average number of files in dir %d,
  5976. >&-272    bequad        x        pending blocks to free %lld,
  5977. >&-264    belong        x        pending inodes to free %ld,
  5978. >&-664    bequad        x        system-wide uuid %0llx,
  5979. >&-1316    belong        x        minimum percentage of free blocks %d,
  5980. >&-1248    belong        0        TIME optimization
  5981. >&-1248    belong        1        SPACE optimization
  5982.  
  5983. # ext2/ext3 filesystems - Andreas Dilger <adilger@dilger.ca>
  5984. # ext4 filesystem - Eric Sandeen <sandeen@sandeen.net>
  5985. # volume label and UUID Russell Coker
  5986. # http://etbe.coker.com.au/2008/07/08/label-vs-uuid-vs-device/
  5987. 0x438   leshort         0xEF53          Linux
  5988. >0x44c  lelong          x               rev %d
  5989. >0x43e  leshort         x               \b.%d
  5990. # No journal?  ext2
  5991. >0x45c  lelong          ^0x0000004      ext2 filesystem data
  5992. >>0x43a leshort         ^0x0000001      (mounted or unclean)
  5993. # Has a journal?  ext3 or ext4
  5994. >0x45c  lelong          &0x0000004
  5995. #  and small INCOMPAT?
  5996. >>0x460 lelong          <0x0000040
  5997. #   and small RO_COMPAT?
  5998. >>>0x464 lelong         <0x0000008      ext3 filesystem data
  5999. #   else large RO_COMPAT?
  6000. >>>0x464 lelong         >0x0000007      ext4 filesystem data
  6001. #  else large INCOMPAT?
  6002. >>0x460    lelong          >0x000003f      ext4 filesystem data
  6003. >0x468    belong        x        \b, UUID=%x
  6004. >0x46c    beshort        x        \b-%x
  6005. >0x46e    beshort        x        \b-%x
  6006. >0x470    beshort        x        \b-%x
  6007. >0x472    belong        x        \b-%x
  6008. >0x476    beshort        x        \b%x
  6009. >0x478    string        >0        \b, volume name "%s"
  6010. # General flags for any ext* fs
  6011. >0x460    lelong          &0x0000004      (needs journal recovery)
  6012. >0x43a    leshort         &0x0000002      (errors)
  6013. # INCOMPAT flags
  6014. >0x460    lelong          &0x0000001      (compressed)
  6015. #>0x460    lelong          &0x0000002      (filetype)
  6016. #>0x460    lelong          &0x0000010      (meta bg)
  6017. >0x460    lelong          &0x0000040      (extents)
  6018. >0x460    lelong          &0x0000080      (64bit)
  6019. #>0x460    lelong          &0x0000100      (mmp)
  6020. #>0x460    lelong          &0x0000200      (flex bg)
  6021. # RO_INCOMPAT flags
  6022. #>0x464    lelong          &0x0000001      (sparse super)
  6023. >0x464    lelong          &0x0000002      (large files)
  6024. >0x464    lelong          &0x0000008      (huge files)
  6025. #>0x464    lelong          &0x0000010      (gdt checksum)
  6026. #>0x464    lelong          &0x0000020      (many subdirs)
  6027. #>0x463    lelong          &0x0000040      (extra isize)
  6028.  
  6029. # SGI disk labels - Nathan Scott <nathans@debian.org>
  6030. 0    belong        0x0BE5A941    SGI disk label (volume header)
  6031.  
  6032. # SGI XFS filesystem - Nathan Scott <nathans@debian.org>
  6033. 0    belong        0x58465342    SGI XFS filesystem data
  6034. >0x4    belong        x        (blksz %d,
  6035. >0x68    beshort        x        inosz %d,
  6036. >0x64    beshort        ^0x2004        v1 dirs)
  6037. >0x64    beshort        &0x2004        v2 dirs)
  6038.  
  6039. ############################################################################
  6040. # Minix-ST kernel floppy
  6041. 0x800    belong        0x46fc2700    Atari-ST Minix kernel image
  6042. >19    string        \240\5\371\5\0\011\0\2\0    \b, 720k floppy
  6043. >19    string        \320\2\370\5\0\011\0\1\0    \b, 360k floppy
  6044.  
  6045. ############################################################################
  6046. # Hmmm, is this a better way of detecting _standard_ floppy images ?
  6047. 19    string        \320\2\360\3\0\011\0\1\0    DOS floppy 360k
  6048. >0x1FE    leshort        0xAA55        \b, x86 hard disk boot sector
  6049. 19    string        \240\5\371\3\0\011\0\2\0    DOS floppy 720k
  6050. >0x1FE    leshort        0xAA55        \b, x86 hard disk boot sector
  6051. 19    string        \100\013\360\011\0\022\0\2\0    DOS floppy 1440k
  6052. >0x1FE    leshort        0xAA55        \b, x86 hard disk boot sector
  6053.  
  6054. 19    string        \240\5\371\5\0\011\0\2\0    DOS floppy 720k, IBM
  6055. >0x1FE    leshort        0xAA55        \b, x86 hard disk boot sector
  6056. 19    string        \100\013\371\5\0\011\0\2\0    DOS floppy 1440k, mkdosfs
  6057. >0x1FE    leshort        0xAA55        \b, x86 hard disk boot sector
  6058.  
  6059. 19    string        \320\2\370\5\0\011\0\1\0    Atari-ST floppy 360k
  6060. 19    string        \240\5\371\5\0\011\0\2\0    Atari-ST floppy 720k
  6061.  
  6062. #  Valid media descriptor bytes for MS-DOS:
  6063. #
  6064. #     Byte   Capacity   Media Size and Type
  6065. #     -------------------------------------------------
  6066. #
  6067. #     F0     2.88 MB    3.5-inch, 2-sided, 36-sector
  6068. #     F0     1.44 MB    3.5-inch, 2-sided, 18-sector
  6069. #     F9     720K       3.5-inch, 2-sided, 9-sector
  6070. #     F9     1.2 MB     5.25-inch, 2-sided, 15-sector
  6071. #     FD     360K       5.25-inch, 2-sided, 9-sector
  6072. #     FF     320K       5.25-inch, 2-sided, 8-sector
  6073. #     FC     180K       5.25-inch, 1-sided, 9-sector
  6074. #     FE     160K       5.25-inch, 1-sided, 8-sector
  6075. #     FE     250K       8-inch, 1-sided, single-density
  6076. #     FD     500K       8-inch, 2-sided, single-density
  6077. #     FE     1.2 MB     8-inch, 2-sided, double-density
  6078. #     F8     -----      Fixed disk 
  6079. #
  6080. #     FC     xxxK       Apricot 70x1x9 boot disk.
  6081. #
  6082. # Originally a bitmap:
  6083. #  xxxxxxx0    Not two sided
  6084. #  xxxxxxx1    Double sided
  6085. #  xxxxxx0x    Not 8 SPT
  6086. #  xxxxxx1x    8 SPT
  6087. #  xxxxx0xx    Not Removable drive
  6088. #  xxxxx1xx    Removable drive
  6089. #  11111xxx    Must be one.
  6090. #
  6091. # But now it's rather random:
  6092. #  111111xx    Low density disk
  6093. #        00    SS, Not 8 SPT
  6094. #        01    DS, Not 8 SPT
  6095. #        10    SS, 8 SPT
  6096. #        11    DS, 8 SPT
  6097. #
  6098. #  11111001    Double density 3Ī© floppy disk, high density 5Āŗ
  6099. #  11110000    High density 3Ī© floppy disk
  6100. #  11111000    Hard disk any format
  6101. #
  6102.  
  6103. # CDROM Filesystems
  6104. # Modified for UDF by gerardo.cacciari@gmail.com
  6105. 32769    string    CD001
  6106. !:mime    application/x-iso9660-image
  6107. >38913    string   !NSR0      ISO 9660 CD-ROM filesystem data
  6108. >38913    string    NSR0      UDF filesystem data
  6109. >>38917    string    1         (version 1.0)
  6110. >>38917    string    2         (version 1.5)
  6111. >>38917    string    3         (version 2.0)
  6112. >>38917    byte     >0x33      (unknown version, ID 0x%X)
  6113. >>38917    byte     <0x31      (unknown version, ID 0x%X)
  6114. # "application id" which appears to be used as a volume label
  6115. >32808    string    >\0       '%s'
  6116. >34816    string    \000CD001\001EL\ TORITO\ SPECIFICATION    (bootable)
  6117. 37633    string    CD001     ISO 9660 CD-ROM filesystem data (raw 2352 byte sectors)
  6118. !:mime    application/x-iso9660-image
  6119. 32776    string    CDROM     High Sierra CD-ROM filesystem data
  6120.  
  6121. # cramfs filesystem - russell@coker.com.au
  6122. 0       lelong    0x28cd3d45      Linux Compressed ROM File System data, little endian
  6123. >4      lelong  x size %lu
  6124. >8      lelong  &1 version #2
  6125. >8      lelong  &2 sorted_dirs
  6126. >8      lelong  &4 hole_support
  6127. >32     lelong  x CRC 0x%x,
  6128. >36     lelong  x edition %lu,
  6129. >40     lelong  x %lu blocks,
  6130. >44     lelong  x %lu files
  6131.  
  6132. 0       belong    0x28cd3d45      Linux Compressed ROM File System data, big endian
  6133. >4      belong  x size %lu
  6134. >8      belong  &1 version #2
  6135. >8      belong  &2 sorted_dirs
  6136. >8      belong  &4 hole_support
  6137. >32     belong  x CRC 0x%x,
  6138. >36     belong  x edition %lu,
  6139. >40     belong  x %lu blocks,
  6140. >44     belong  x %lu files
  6141.  
  6142. # reiserfs - russell@coker.com.au
  6143. 0x10034        string    ReIsErFs    ReiserFS V3.5
  6144. 0x10034        string    ReIsEr2Fs    ReiserFS V3.6
  6145. 0x10034        string    ReIsEr3Fs    ReiserFS V3.6.19
  6146. >0x1002c     leshort    x        block size %d
  6147. >0x10032    leshort    &2        (mounted or unclean)
  6148. >0x10000    lelong    x        num blocks %d
  6149. >0x10040    lelong    1        tea hash
  6150. >0x10040    lelong    2        yura hash
  6151. >0x10040    lelong    3        r5 hash
  6152.  
  6153. # JFFS - russell@coker.com.au
  6154. 0    lelong    0x34383931    Linux Journalled Flash File system, little endian
  6155. 0    belong    0x34383931    Linux Journalled Flash File system, big endian
  6156.  
  6157. # EST flat binary format (which isn't, but anyway)
  6158. # From: Mark Brown <broonie@sirena.org.uk>
  6159. 0    string    ESTFBINR    EST flat binary
  6160.  
  6161. # Aculab VoIP firmware
  6162. # From: Mark Brown <broonie@sirena.org.uk>
  6163. 0    string    VoIP\ Startup\ and    Aculab VoIP firmware
  6164. >35    string    x    format %s
  6165.  
  6166. # u-boot/PPCBoot image file
  6167. # From: Mark Brown <broonie@sirena.org.uk>
  6168. 0    belong    0x27051956    u-boot/PPCBoot image
  6169. >4    string  PPCBoot
  6170. >>12    string  x        version %s
  6171.  
  6172. # JFFS2 file system
  6173. 0    leshort    0x1984        Linux old jffs2 filesystem data little endian
  6174. 0    leshort    0x1985        Linux jffs2 filesystem data little endian
  6175.  
  6176. # Squashfs
  6177. 0    string    sqsh    Squashfs filesystem, big endian,
  6178. >28    beshort    x    version %d.
  6179. >30    beshort x    \b%d,
  6180. >28    beshort <3
  6181. >>8    belong    x    %d bytes,
  6182. >28    beshort >2
  6183. >>63    bequad x    %lld bytes,
  6184. #>>67    belong    x    %d bytes,
  6185. >4    belong    x    %d inodes,
  6186. >28    beshort <2
  6187. >>32    beshort    x    blocksize: %d bytes,
  6188. >28    beshort >1
  6189. >>51    belong    x    blocksize: %d bytes,
  6190. >39    bedate    x    created: %s
  6191. 0    string    hsqs    Squashfs filesystem, little endian,
  6192. >28    leshort    x    version %d.
  6193. >30    leshort    x    \b%d,
  6194. >28    leshort <3
  6195. >>8    lelong    x    %d bytes,
  6196. >28    leshort >2
  6197. >>63    lequad x    %lld bytes,
  6198. #>>63    lelong    x    %d bytes,
  6199. >4    lelong    x    %d inodes,
  6200. >28    leshort <2
  6201. >>32    leshort    x    blocksize: %d bytes,
  6202. >28    leshort >1
  6203. >>51    lelong    x    blocksize: %d bytes,
  6204. >39    ledate    x    created: %s
  6205.  
  6206. 0    string        td\000        floppy image data (TeleDisk)
  6207.  
  6208. # AFS Dump Magic
  6209. # From: Ty Sarna <tsarna@sarna.org> 
  6210. 0       string                  \x01\xb3\xa1\x13\x22    AFS Dump
  6211. >&0     belong                  x                       (v%d)
  6212. >>&0    byte                    0x76
  6213. >>>&0   belong                  x                       Vol %d,
  6214. >>>>&0  byte                    0x6e
  6215. >>>>>&0 string                  x                       %s
  6216. >>>>>>&1        byte            0x74
  6217. >>>>>>>&0       beshort         2
  6218. >>>>>>>>&4      bedate          x                       on: %s
  6219. >>>>>>>>&0      bedate          =0                      full dump
  6220. >>>>>>>>&0      bedate          !0                      incremental since: %s
  6221.  
  6222. #----------------------------------------------------------
  6223. # VMS backup savesets - gerardo.cacciari@gmail.com
  6224. #
  6225. 4            string  \x01\x00\x01\x00\x01\x00
  6226. >(0.s+16)    string  \x01\x01
  6227. >>&(&0.b+8)  byte    0x42       OpenVMS backup saveset data
  6228. >>>40        lelong  x          (block size %d,
  6229. >>>49        string  >\0        original name '%s',
  6230. >>>2         short   1024       VAX generated)
  6231. >>>2         short   2048       AXP generated)
  6232. >>>2         short   4096       I64 generated)
  6233.  
  6234. # Summary: Oracle Clustered Filesystem
  6235. # Created by: Aaron Botsis <redhat@digitalmafia.org>
  6236. 8    string        OracleCFS    Oracle Clustered Filesystem,
  6237. >4    long        x        rev %d
  6238. >0    long        x        \b.%d,
  6239. >560    string        x        label: %.64s,
  6240. >136    string        x        mountpoint: %.128s
  6241.  
  6242. # Summary: Oracle ASM tagged volume
  6243. # Created by: Aaron Botsis <redhat@digitalmafia.org>
  6244. 32    string        ORCLDISK    Oracle ASM Volume,
  6245. >40    string        x        Disk Name: %0.12s
  6246. 32    string        ORCLCLRD    Oracle ASM Volume (cleared),
  6247. >40    string        x        Disk Name: %0.12s
  6248.  
  6249. # Oracle Clustered Filesystem - Aaron Botsis <redhat@digitalmafia.org>
  6250. 8    string        OracleCFS    Oracle Clustered Filesystem,
  6251. >4    long        x        rev %d
  6252. >0    long        x        \b.%d,
  6253. >560    string        x        label: %.64s,
  6254. >136    string        x        mountpoint: %.128s
  6255.  
  6256. # Oracle ASM tagged volume - Aaron Botsis <redhat@digitalmafia.org>
  6257. 32    string        ORCLDISK    Oracle ASM Volume,
  6258. >40    string        x        Disk Name: %0.12s
  6259. 32    string        ORCLCLRD    Oracle ASM Volume (cleared),
  6260. >40    string        x        Disk Name: %0.12s
  6261.  
  6262. # Compaq/HP RILOE floppy image
  6263. # From: Dirk Jagdmann <doj@cubic.org>
  6264. 0    string    CPQRFBLO    Compaq/HP RILOE floppy image
  6265.  
  6266. #------------------------------------------------------------------------------
  6267. # Files-11 On-Disk Structure (OpenVMS file system) - gerardo.cacciari@gmail.com
  6268. # These bits come from LBN 1 (home block) of ODS-2 and ODS-5 volumes, which is
  6269. # mapped to VBN 2 of [000000]INDEXF.SYS;1
  6270. #
  6271. 1008    string          DECFILE11B      Files-11 On-Disk Structure
  6272. >525    byte            x               Level %d
  6273. >525    byte            x               (ODS-%d OpenVMS file system),
  6274. >984    string          x               volume label is '%-12.12s'
  6275.  
  6276. # From: Thomas Klausner <wiz@NetBSD.org>
  6277. # http://filext.com/file-extension/DAA
  6278. # describes the daa file format. The magic would be:
  6279. 0    string        DAA\x0\x0\x0\x0\x0    PowerISO Direct-Access-Archive
  6280.  
  6281. # From Albert Cahalan <acahalan@gmail.com>
  6282. # really le32 operation,destination,payloadsize (but quite predictable)
  6283. # 01 00 00 00 00 00 00 c0 00 02 00 00
  6284. 0    string        \1\0\0\0\0\0\0\300\0\2\0\0    Marvell Libertas firmware
  6285.  
  6286. # From Eric Sandeen
  6287. # GFS2
  6288. 0x10000         belong          0x01161970      GFS2 Filesystem
  6289. >0x10024        belong          x               (blocksize %d,
  6290. >0x10060        string          >\0             lockproto %s)
  6291.  
  6292. # dvdisaster's .ecc
  6293. # From: "Nelson A. de Oliveira" <naoliv@gmail.com>
  6294. 0    string    *dvdisaster*    dvdisaster error correction file
  6295.  
  6296. # Type:    CROM filesystem
  6297. # From:    Werner Fink <werner@suse.de>
  6298. 0    string    CROMFS    CROMFS
  6299. >6    string    >\0    \b version %2.2s,
  6300. >8    ulequad    >0    \b block data at %lld,
  6301. >16    ulequad    >0    \b fblock table at %lld,
  6302. >24    ulequad    >0    \b inode table at %lld,
  6303. >32    ulequad    >0    \b root at %lld,
  6304. >40    ulelong    >0    \b fblock size = %ld,
  6305. >44    ulelong    >0    \b block size = %ld,
  6306. >48    ulequad    >0    \b bytes = %lld
  6307.  
  6308. #------------------------------------------------------------------------------
  6309. # flash:    file(1) magic for Macromedia Flash file format
  6310. #
  6311. # See
  6312. #
  6313. #    http://www.macromedia.com/software/flash/open/
  6314. #
  6315. 0    string        FWS        Macromedia Flash data,
  6316. >3    byte        x        version %d
  6317. !:mime    application/x-shockwave-flash
  6318. 0    string        CWS        Macromedia Flash data (compressed),
  6319. !:mime    application/x-shockwave-flash
  6320. >3    byte        x        version %d
  6321. # From: Cal Peake <cp@absolutedigital.net>
  6322. 0    string        FLV        Macromedia Flash Video
  6323. !:mime    video/x-flv
  6324.  
  6325. #
  6326. # From Dave Wilson
  6327. 0    string AGD4\xbe\xb8\xbb\xcb\x00    Macromedia Freehand 9 Document
  6328. #------------------------------------------------------------------------------
  6329. # fonts:  file(1) magic for font data
  6330. #
  6331. 0    search/1    FONT        ASCII vfont text
  6332. 0    short        0436        Berkeley vfont data
  6333. 0    short        017001        byte-swapped Berkeley vfont data
  6334.  
  6335. # PostScript fonts (must precede "printer" entries), quinlan@yggdrasil.com
  6336. 0    search/1    %!PS-AdobeFont-1.    PostScript Type 1 font text
  6337. >20    search/1    >\0            (%s)
  6338. 6    string        %!PS-AdobeFont-1.    PostScript Type 1 font program data
  6339.  
  6340. # X11 font files in SNF (Server Natural Format) format
  6341. 0    belong        00000004        X11 SNF font data, MSB first
  6342. 0    lelong        00000004        X11 SNF font data, LSB first
  6343.  
  6344. # X11 Bitmap Distribution Format, from Daniel Quinlan (quinlan@yggdrasil.com)
  6345. 0    search/1    STARTFONT\         X11 BDF font text
  6346.  
  6347. # X11 fonts, from Daniel Quinlan (quinlan@yggdrasil.com)
  6348. # PCF must come before SGI additions ("MIPSEL MIPS-II COFF" collides)
  6349. 0    string        \001fcp            X11 Portable Compiled Font data
  6350. >12    byte        0x02            \b, LSB first
  6351. >12    byte        0x0a            \b, MSB first
  6352. 0    string        D1.0\015        X11 Speedo font data
  6353.  
  6354. #------------------------------------------------------------------------------
  6355. # FIGlet fonts and controlfiles
  6356. # From figmagic supplied with Figlet version 2.2
  6357. # "David E. O'Brien" <obrien@FreeBSD.ORG>
  6358. 0    string        flf        FIGlet font
  6359. >3    string        >2a        version %-2.2s
  6360. 0    string        flc        FIGlet controlfile
  6361. >3    string        >2a        version %-2.2s
  6362.  
  6363. # libGrx graphics lib fonts, from Albert Cahalan (acahalan@cs.uml.edu)
  6364. # Used with djgpp (DOS Gnu C++), sometimes Linux or Turbo C++
  6365. 0    belong        0x14025919    libGrx font data,
  6366. >8    leshort        x        %dx
  6367. >10    leshort        x        \b%d
  6368. >40    string        x        %s
  6369. # Misc. DOS VGA fonts, from Albert Cahalan (acahalan@cs.uml.edu)
  6370. 0    belong        0xff464f4e    DOS code page font data collection
  6371. 7    belong        0x00454741    DOS code page font data
  6372. 7    belong        0x00564944    DOS code page font data (from Linux?)
  6373. 4098    string        DOSFONT        DOSFONT2 encrypted font data
  6374.  
  6375. # downloadable fonts for browser (prints type) anthon@mnt.org
  6376. 0    string        PFR1        PFR1 font
  6377. >102    string        >0        \b: %s
  6378.  
  6379. # True Type fonts
  6380. 0    string    \000\001\000\000\000    TrueType font data
  6381.  
  6382. 0    string        \007\001\001\000Copyright\ (c)\ 199    Adobe Multiple Master font
  6383. 0    string        \012\001\001\000Copyright\ (c)\ 199    Adobe Multiple Master font
  6384.  
  6385. # Opentype font data from Avi Bercovich
  6386. 0    string        OTTO        OpenType font data 
  6387.  
  6388. # Gürkan Sengün <gurkan@linuks.mine.nu>, www.linuks.mine.nu 
  6389. 0    string        SplineFontDB:    Spline Font Database 
  6390. >14    string        x        version %s
  6391. # FORTRAN source
  6392. 0    string/c    c\         FORTRAN program
  6393. !:mime    text/x-fortran
  6394. #------------------------------------------------------------------------------
  6395. # frame:  file(1) magic for FrameMaker files
  6396. #
  6397. # This stuff came on a FrameMaker demo tape, most of which is
  6398. # copyright, but this file is "published" as witness the following:
  6399. #
  6400. # Note that this is the Framemaker Maker Interchange Format, not the
  6401. # Normal format which would be application/vnd.framemaker.
  6402. #
  6403. 0    string        \<MakerFile    FrameMaker document
  6404. !:mime    application/x-mif
  6405. >11    string        5.5         (5.5
  6406. >11    string        5.0         (5.0
  6407. >11    string        4.0         (4.0
  6408. >11    string        3.0         (3.0
  6409. >11    string        2.0         (2.0
  6410. >11    string        1.0         (1.0
  6411. >14    byte        x          %c)
  6412. 0    string        \<MIFFile    FrameMaker MIF (ASCII) file
  6413. !:mime    application/x-mif
  6414. >9    string        4.0         (4.0)
  6415. >9    string        3.0         (3.0)
  6416. >9    string        2.0         (2.0)
  6417. >9    string        1.0         (1.x)
  6418. 0    search/1    \<MakerDictionary    FrameMaker Dictionary text
  6419. !:mime    application/x-mif
  6420. >17    string        3.0         (3.0)
  6421. >17    string        2.0         (2.0)
  6422. >17    string        1.0         (1.x)
  6423. 0    string        \<MakerScreenFont    FrameMaker Font file
  6424. !:mime    application/x-mif
  6425. >17    string        1.01         (%s)
  6426. 0    string        \<MML        FrameMaker MML file
  6427. !:mime    application/x-mif
  6428. 0    string        \<BookFile    FrameMaker Book file
  6429. !:mime    application/x-mif
  6430. >10    string        3.0         (3.0
  6431. >10    string        2.0         (2.0
  6432. >10    string        1.0         (1.0
  6433. >13    byte        x          %c)
  6434. # XXX - this book entry should be verified, if you find one, uncomment this
  6435. #0    string        \<Book\     FrameMaker Book (ASCII) file
  6436. #!:mime    application/x-mif
  6437. #>6    string        3.0         (3.0)
  6438. #>6    string        2.0         (2.0)
  6439. #>6    string        1.0         (1.0)
  6440. 0    string        \<Maker    Intermediate Print File    FrameMaker IPL file
  6441. !:mime    application/x-mif
  6442.  
  6443. #------------------------------------------------------------------------------
  6444. # freebsd:  file(1) magic for FreeBSD objects
  6445. #
  6446. # All new-style FreeBSD magic numbers are in host byte order (i.e.,
  6447. # little-endian on x86).
  6448. #
  6449. # XXX - this comes from the file "freebsd" in a recent FreeBSD version of
  6450. # "file"; it, and the NetBSD stuff in "netbsd", appear to use different
  6451. # schemes for distinguishing between executable images, shared libraries,
  6452. # and object files.
  6453. #
  6454. # FreeBSD says:
  6455. #
  6456. #    Regardless of whether it's pure, demand-paged, or none of the
  6457. #    above:
  6458. #
  6459. #    if the entry point is < 4096, then it's a shared library if
  6460. #    the "has run-time loader information" bit is set, and is
  6461. #    position-independent if the "is position-independent" bit
  6462. #    is set;
  6463. #
  6464. #    if the entry point is >= 4096 (or >4095, same thing), then it's
  6465. #    an executable, and is dynamically-linked if the "has run-time
  6466. #    loader information" bit is set.
  6467. #
  6468. # On x86, NetBSD says:
  6469. #
  6470. #    If it's neither pure nor demand-paged:
  6471. #
  6472. #    if it has the "has run-time loader information" bit set, it's
  6473. #    a dynamically-linked executable;
  6474. #
  6475. #    if it doesn't have that bit set, then:
  6476. #
  6477. #        if it has the "is position-independent" bit set, it's
  6478. #        position-independent;
  6479. #
  6480. #        if the entry point is non-zero, it's an executable, otherwise
  6481. #        it's an object file.
  6482. #
  6483. #    If it's pure:
  6484. #
  6485. #    if it has the "has run-time loader information" bit set, it's
  6486. #    a dynamically-linked executable, otherwise it's just an
  6487. #    executable.
  6488. #
  6489. #    If it's demand-paged:
  6490. #
  6491. #    if it has the "has run-time loader information" bit set,
  6492. #    then:
  6493. #
  6494. #        if the entry point is < 4096, it's a shared library;
  6495. #
  6496. #        if the entry point is = 4096 or > 4096 (i.e., >= 4096),
  6497. #        it's a dynamically-linked executable);
  6498. #
  6499. #    if it doesn't have the "has run-time loader information" bit
  6500. #    set, then it's just an executable.
  6501. #
  6502. # (On non-x86, NetBSD does much the same thing, except that it uses
  6503. # 8192 on 68K - except for "68k4k", which is presumably "68K with 4K
  6504. # pages - SPARC, and MIPS, presumably because Sun-3's and Sun-4's
  6505. # had 8K pages; dunno about MIPS.)
  6506. #
  6507. # I suspect the two will differ only in perverse and uninteresting cases
  6508. # ("shared" libraries that aren't demand-paged and whose pages probably
  6509. # won't actually be shared, executables with entry points <4096).
  6510. #
  6511. # I leave it to those more familiar with FreeBSD and NetBSD to figure out
  6512. # what the right answer is (although using ">4095", FreeBSD-style, is
  6513. # probably better than separately checking for "=4096" and ">4096",
  6514. # NetBSD-style).  (The old "netbsd" file analyzed FreeBSD demand paged
  6515. # executables using the NetBSD technique.)
  6516. #
  6517. 0    lelong&0377777777    041400407    FreeBSD/i386
  6518. >20    lelong            <4096
  6519. >>3    byte&0xC0        &0x80        shared library
  6520. >>3    byte&0xC0        0x40        PIC object
  6521. >>3    byte&0xC0        0x00        object
  6522. >20    lelong            >4095
  6523. >>3    byte&0x80        0x80        dynamically linked executable
  6524. >>3    byte&0x80        0x00        executable
  6525. >16    lelong            >0        not stripped
  6526.  
  6527. 0    lelong&0377777777    041400410    FreeBSD/i386 pure
  6528. >20    lelong            <4096
  6529. >>3    byte&0xC0        &0x80        shared library
  6530. >>3    byte&0xC0        0x40        PIC object
  6531. >>3    byte&0xC0        0x00        object
  6532. >20    lelong            >4095
  6533. >>3    byte&0x80        0x80        dynamically linked executable
  6534. >>3    byte&0x80        0x00        executable
  6535. >16    lelong            >0        not stripped
  6536.  
  6537. 0    lelong&0377777777    041400413    FreeBSD/i386 demand paged
  6538. >20    lelong            <4096
  6539. >>3    byte&0xC0        &0x80        shared library
  6540. >>3    byte&0xC0        0x40        PIC object
  6541. >>3    byte&0xC0        0x00        object
  6542. >20    lelong            >4095
  6543. >>3    byte&0x80        0x80        dynamically linked executable
  6544. >>3    byte&0x80        0x00        executable
  6545. >16    lelong            >0        not stripped
  6546.  
  6547. 0    lelong&0377777777    041400314    FreeBSD/i386 compact demand paged
  6548. >20    lelong            <4096
  6549. >>3    byte&0xC0        &0x80        shared library
  6550. >>3    byte&0xC0        0x40        PIC object
  6551. >>3    byte&0xC0        0x00        object
  6552. >20    lelong            >4095
  6553. >>3    byte&0x80        0x80        dynamically linked executable
  6554. >>3    byte&0x80        0x00        executable
  6555. >16    lelong            >0        not stripped
  6556.  
  6557. # XXX gross hack to identify core files
  6558. # cores start with a struct tss; we take advantage of the following:
  6559. # byte 7:     highest byte of the kernel stack pointer, always 0xfe
  6560. #      8/9:   kernel (ring 0) ss value, always 0x0010
  6561. #      10 - 27: ring 1 and 2 ss/esp, unused, thus always 0
  6562. #      28:    low order byte of the current PTD entry, always 0 since the
  6563. #             PTD is page-aligned
  6564. #
  6565. 7    string    \357\020\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0    FreeBSD/i386 a.out core file
  6566. >1039    string    >\0    from '%s'
  6567.  
  6568. # /var/run/ld.so.hints
  6569. # What are you laughing about?
  6570. 0    lelong            011421044151    ld.so hints file (Little Endian
  6571. >4    lelong            >0        \b, version %d)
  6572. >4    belong            <1        \b)
  6573. 0    belong            011421044151    ld.so hints file (Big Endian
  6574. >4    belong            >0        \b, version %d)
  6575. >4    belong            <1        \b)
  6576.  
  6577. #
  6578. # Files generated by FreeBSD scrshot(1)/vidcontrol(1) utilities
  6579. #
  6580. 0    string    SCRSHOT_    scrshot(1) screenshot,
  6581. >8    byte    x        version %d,
  6582. >9    byte    2        %d bytes in header,
  6583. >>10    byte    x        %d chars wide by
  6584. >>11    byte    x        %d chars high
  6585.  
  6586. #------------------------------------------------------------------------------
  6587. # fsav:  file(1) magic for datafellows fsav virus definition files
  6588. # Anthon van der Neut (anthon@mnt.org)
  6589.  
  6590. # ftp://ftp.f-prot.com/pub/{macrdef2.zip,nomacro.def}
  6591. 0    beshort        0x1575        fsav macro virus signatures
  6592. >8    leshort        >0        (%d-
  6593. >11    byte        >0        \b%02d-
  6594. >10    byte        >0        \b%02d)
  6595. # ftp://ftp.f-prot.com/pub/sign.zip
  6596. #10    ubyte        <12
  6597. #>9    ubyte        <32
  6598. #>>8    ubyte        0x0a
  6599. #>>>12    ubyte        0x07
  6600. #>>>>11    uleshort    >0        fsav DOS/Windows virus signatures (%d-
  6601. #>>>>10    byte        0        \b01-
  6602. #>>>>10    byte        1        \b02-
  6603. #>>>>10    byte        2        \b03-
  6604. #>>>>10    byte        3        \b04-
  6605. #>>>>10    byte        4        \b05-
  6606. #>>>>10    byte        5        \b06-
  6607. #>>>>10    byte        6        \b07-
  6608. #>>>>10    byte        7        \b08-
  6609. #>>>>10    byte        8        \b09-
  6610. #>>>>10    byte        9        \b10-
  6611. #>>>>10    byte        10        \b11-
  6612. #>>>>10    byte        11        \b12-
  6613. #>>>>9    ubyte        >0        \b%02d)
  6614. # ftp://ftp.f-prot.com/pub/sign2.zip
  6615. #0    ubyte        0x62        
  6616. #>1    ubyte        0xF5        
  6617. #>>2    ubyte        0x1        
  6618. #>>>3    ubyte        0x1        
  6619. #>>>>4    ubyte        0x0e        
  6620. #>>>>>13        ubyte    >0        fsav virus signatures
  6621. #>>>>>>11    ubyte    x        size 0x%02x
  6622. #>>>>>>12    ubyte    x        \b%02x
  6623. #>>>>>>13    ubyte    x        \b%02x bytes
  6624.  
  6625. # Joerg Jenderek: joerg dot jenderek at web dot de
  6626. # http://www.clamav.net/doc/latest/html/node45.html
  6627. # .cvd files start with a 512 bytes colon separated header
  6628. # ClamAV-VDB:buildDate:version:signaturesNumbers:functionalityLevelRequired:MD5:Signature:builder:buildTime
  6629. # + gzipped tarball files
  6630. 0    string        ClamAV-VDB:    
  6631. >11    string        >\0        Clam AntiVirus database %-.23s
  6632. >>34    string        :        
  6633. >>>35        string        !:    \b, version 
  6634. >>>>35        string        x     \b%-.1s
  6635. >>>>>36        string         !:    
  6636. >>>>>>36    string        x     \b%-.1s
  6637. >>>>>>>37    string        !:    
  6638. >>>>>>>>37    string        x     \b%-.1s
  6639. >>>>>>>>>38    string        !:    
  6640. >>>>>>>>>>38    string        x     \b%-.1s
  6641. >512    string        \037\213    \b, gzipped
  6642. >769    string        ustar\0        \b, tarred
  6643.  
  6644. # Type: Grisoft AVG AntiVirus
  6645. # From: David Newgas <david@newgas.net>
  6646. 0    string    AVG7_ANTIVIRUS_VAULT_FILE    AVG 7 Antivirus vault file data
  6647. #------------------------------------------------------------------------------
  6648. # games:  file(1) for games
  6649.  
  6650. # Fabio Bonelli <fabiobonelli@libero.it>
  6651. # Quake II - III data files
  6652. 0       string  IDP2            Quake II 3D Model file,
  6653. >20     long    x               %lu skin(s),
  6654. >8      long    x               (%lu x
  6655. >12     long    x         %lu),
  6656. >40     long    x               %lu frame(s),
  6657. >16     long    x               Frame size %lu bytes,
  6658. >24     long      x               %lu vertices/frame,
  6659. >28     long    x                %lu texture coordinates,
  6660. >32     long    x               %lu triangles/frame
  6661.  
  6662. 0       string  IBSP            Quake
  6663. >4      long    0x26            II Map file (BSP)
  6664. >4      long    0x2E          III Map file (BSP)
  6665.  
  6666. 0       string  IDS2            Quake II SP2 sprite file
  6667.  
  6668. #---------------------------------------------------------------------------
  6669. # Doom and Quake
  6670. # submitted by Nicolas Patrois
  6671.  
  6672. 0       string  \xcb\x1dBoom\xe6\xff\x03\x01    Boom or linuxdoom demo
  6673. # some doom lmp files don't match, I've got one beginning with \x6d\x02\x01\x01
  6674.  
  6675. 24      string  LxD\ 203        Linuxdoom save
  6676. >0      string  x       , name=%s
  6677. >44     string  x       , world=%s
  6678.  
  6679. # Quake
  6680.  
  6681. 0       string  PACK    Quake I or II world or extension
  6682.  
  6683. #0       string  -1\x0a  Quake I demo
  6684. #>30     string  x        version %.4s
  6685. #>61     string  x        level %s       
  6686.  
  6687. #0       string  5\x0a   Quake I save
  6688.  
  6689. # The levels
  6690.  
  6691. # Quake 1
  6692.  
  6693. 0    string    5\x0aIntroduction             Quake I save: start Introduction
  6694. 0    string    5\x0athe_Slipgate_Complex     Quake I save: e1m1 The slipgate complex
  6695. 0    string    5\x0aCastle_of_the_Damned     Quake I save: e1m2 Castle of the damned
  6696. 0    string    5\x0athe_Necropolis           Quake I save: e1m3 The necropolis
  6697. 0    string    5\x0athe_Grisly_Grotto        Quake I save: e1m4 The grisly grotto
  6698. 0    string    5\x0aZiggurat_Vertigo         Quake I save: e1m8 Ziggurat vertigo (secret)
  6699. 0    string    5\x0aGloom_Keep               Quake I save: e1m5 Gloom keep
  6700. 0    string    5\x0aThe_Door_To_Chthon       Quake I save: e1m6 The door to Chthon
  6701. 0    string    5\x0aThe_House_of_Chthon      Quake I save: e1m7 The house of Chthon
  6702. 0    string    5\x0athe_Installation         Quake I save: e2m1 The installation
  6703. 0    string    5\x0athe_Ogre_Citadel         Quake I save: e2m2 The ogre citadel
  6704. 0    string    5\x0athe_Crypt_of_Decay       Quake I save: e2m3 The crypt of decay (dopefish lives!)
  6705. 0    string    5\x0aUnderearth               Quake I save: e2m7 Underearth (secret)
  6706. 0    string    5\x0athe_Ebon_Fortress        Quake I save: e2m4 The ebon fortress
  6707. 0    string    5\x0athe_Wizard's_Manse       Quake I save: e2m5 The wizard's manse
  6708. 0    string    5\x0athe_Dismal_Oubliette     Quake I save: e2m6 The dismal oubliette
  6709. 0    string    5\x0aTermination_Central      Quake I save: e3m1 Termination central
  6710. 0    string    5\x0aVaults_of_Zin            Quake I save: e3m2 Vaults of Zin
  6711. 0    string    5\x0athe_Tomb_of_Terror       Quake I save: e3m3 The tomb of terror
  6712. 0    string    5\x0aSatan's_Dark_Delight     Quake I save: e3m4 Satan's dark delight
  6713. 0    string    5\x0athe_Haunted_Halls        Quake I save: e3m7 The haunted halls (secret)
  6714. 0    string    5\x0aWind_Tunnels             Quake I save: e3m5 Wind tunnels
  6715. 0    string    5\x0aChambers_of_Torment      Quake I save: e3m6 Chambers of torment
  6716. 0    string    5\x0athe_Sewage_System        Quake I save: e4m1 The sewage system
  6717. 0    string    5\x0aThe_Tower_of_Despair     Quake I save: e4m2 The tower of despair
  6718. 0    string    5\x0aThe_Elder_God_Shrine     Quake I save: e4m3 The elder god shrine
  6719. 0    string    5\x0athe_Palace_of_Hate       Quake I save: e4m4 The palace of hate
  6720. 0    string    5\x0aHell's_Atrium            Quake I save: e4m5 Hell's atrium
  6721. 0    string    5\x0athe_Nameless_City        Quake I save: e4m8 The nameless city (secret)
  6722. 0    string    5\x0aThe_Pain_Maze            Quake I save: e4m6 The pain maze
  6723. 0    string    5\x0aAzure_Agony              Quake I save: e4m7 Azure agony
  6724. 0    string    5\x0aShub-Niggurath's_Pit     Quake I save: end Shub-Niggurath's pit
  6725.  
  6726. # Quake DeathMatch levels
  6727.  
  6728. 0    string    5\x0aPlace_of_Two_Deaths     Quake I save: dm1 Place of two deaths
  6729. 0    string    5\x0aClaustrophobopolis         Quake I save: dm2 Claustrophobopolis
  6730. 0    string    5\x0aThe_Abandoned_Base         Quake I save: dm3 The abandoned base
  6731. 0    string    5\x0aThe_Bad_Place         Quake I save: dm4 The bad place
  6732. 0    string    5\x0aThe_Cistern         Quake I save: dm5 The cistern
  6733. 0    string    5\x0aThe_Dark_Zone         Quake I save: dm6 The dark zone
  6734.  
  6735. # Scourge of Armagon
  6736.  
  6737. 0    string    5\x0aCommand_HQ               Quake I save: start Command HQ
  6738. 0    string    5\x0aThe_Pumping_Station      Quake I save: hip1m1 The pumping station
  6739. 0    string    5\x0aStorage_Facility         Quake I save: hip1m2 Storage facility
  6740. 0    string    5\x0aMilitary_Complex         Quake I save: hip1m5 Military complex (secret)
  6741. 0    string    5\x0athe_Lost_Mine            Quake I save: hip1m3 The lost mine
  6742. 0    string    5\x0aResearch_Facility        Quake I save: hip1m4 Research facility
  6743. 0    string    5\x0aAncient_Realms           Quake I save: hip2m1 Ancient realms
  6744. 0    string    5\x0aThe_Gremlin's_Domain     Quake I save: hip2m6 The gremlin's domain (secret)
  6745. 0    string    5\x0aThe_Black_Cathedral      Quake I save: hip2m2 The black cathedral
  6746. 0    string    5\x0aThe_Catacombs            Quake I save: hip2m3 The catacombs
  6747. 0    string    5\x0athe_Crypt__              Quake I save: hip2m4 The crypt
  6748. 0    string    5\x0aMortum's_Keep            Quake I save: hip2m5 Mortum's keep
  6749. 0    string    5\x0aTur_Torment              Quake I save: hip3m1 Tur torment
  6750. 0    string    5\x0aPandemonium              Quake I save: hip3m2 Pandemonium
  6751. 0    string    5\x0aLimbo                    Quake I save: hip3m3 Limbo
  6752. 0    string    5\x0athe_Edge_of_Oblivion     Quake I save: hipdm1 The edge of oblivion (secret)
  6753. 0    string    5\x0aThe_Gauntlet             Quake I save: hip3m4 The gauntlet
  6754. 0    string    5\x0aArmagon's_Lair           Quake I save: hipend Armagon's lair
  6755.  
  6756. # Malice
  6757.  
  6758. 0    string    5\x0aThe_Academy      Quake I save: start The academy
  6759. 0    string    5\x0aThe_Lab          Quake I save: d1 The lab
  6760. 0    string    5\x0aArea_33          Quake I save: d1b Area 33
  6761. 0    string    5\x0aSECRET_MISSIONS  Quake I save: d3b Secret missions
  6762. 0    string    5\x0aThe_Hospital     Quake I save: d10 The hospital (secret)
  6763. 0    string    5\x0aThe_Genetics_Lab Quake I save: d11 The genetics lab (secret)
  6764. 0    string    5\x0aBACK_2_MALICE    Quake I save: d4b Back to Malice
  6765. 0    string    5\x0aArea44           Quake I save: d1c Area 44
  6766. 0    string    5\x0aTakahiro_Towers  Quake I save: d2 Takahiro towers
  6767. 0    string    5\x0aA_Rat's_Life     Quake I save: d3 A rat's life
  6768. 0    string    5\x0aInto_The_Flood   Quake I save: d4 Into the flood
  6769. 0    string    5\x0aThe_Flood        Quake I save: d5 The flood
  6770. 0    string    5\x0aNuclear_Plant    Quake I save: d6 Nuclear plant
  6771. 0    string    5\x0aThe_Incinerator_Plant    Quake I save: d7 The incinerator plant
  6772. 0    string    5\x0aThe_Foundry              Quake I save: d7b The foundry
  6773. 0    string    5\x0aThe_Underwater_Base      Quake I save: d8 The underwater base
  6774. 0    string    5\x0aTakahiro_Base            Quake I save: d9 Takahiro base
  6775. 0    string    5\x0aTakahiro_Laboratories    Quake I save: d12 Takahiro laboratories
  6776. 0    string    5\x0aStayin'_Alive    Quake I save: d13 Stayin' alive
  6777. 0    string    5\x0aB.O.S.S._HQ      Quake I save: d14 B.O.S.S. HQ
  6778. 0    string    5\x0aSHOWDOWN!        Quake I save: d15 Showdown!
  6779.  
  6780. # Malice DeathMatch levels
  6781.  
  6782. 0    string    5\x0aThe_Seventh_Precinct     Quake I save: ddm1 The seventh precinct
  6783. 0    string    5\x0aSub_Station         Quake I save: ddm2 Sub station
  6784. 0    string    5\x0aCrazy_Eights!         Quake I save: ddm3 Crazy eights!
  6785. 0    string    5\x0aEast_Side_Invertationa     Quake I save: ddm4 East side invertationa
  6786. 0    string    5\x0aSlaughterhouse         Quake I save: ddm5 Slaughterhouse
  6787. 0    string    5\x0aDOMINO             Quake I save: ddm6 Domino
  6788. 0    string    5\x0aSANDRA'S_LADDER         Quake I save: ddm7 Sandra's ladder
  6789.  
  6790.  
  6791. 0    string    MComprHD    MAME CHD compressed hard disk image,
  6792. >12    belong    x        version %lu
  6793.  
  6794. # doom - submitted by Jon Dowland
  6795.  
  6796. 0    string    =IWAD        doom main IWAD data
  6797. >4    lelong    x        containing %d lumps
  6798. 0    string    =PWAD        doom patch PWAD data
  6799. >4    lelong    x        containing %d lumps
  6800.  
  6801.  
  6802. # Summary: Warcraft 3 save
  6803. # Extension: .w3g
  6804. # Created by: "Nelson A. de Oliveira" <naoliv@gmail.com>
  6805. 0    string        Warcraft\ III\ recorded\ game    %s
  6806.  
  6807.  
  6808. # Summary: Warcraft 3 map
  6809. # Extension: .w3m
  6810. # Created by: "Nelson A. de Oliveira" <naoliv@gmail.com>
  6811. 0    string        HM3W        Warcraft III map file
  6812.  
  6813.  
  6814. # Summary: SGF Smart Game Format
  6815. # Extension: .sgf
  6816. # Reference: http://www.red-bean.com/sgf/
  6817. # Created by: Eduardo Sabbatella <eduardo_sabbatella@yahoo.com.ar>
  6818. # Modified by (1): Abel Cheung (regex, more game format)
  6819. # FIXME: Some games don't have GM (game type)
  6820. 0    regex        \\(;.*GM\\[[0-9]{1,2}\\]    Smart Game Format
  6821. >2    search/0x200    GM[
  6822. >>&0    string        1]    (Go)
  6823. >>&0    string        2]    (Othello)
  6824. >>&0    string        3]    (chess)
  6825. >>&0    string        4]    (Gomoku+Renju)
  6826. >>&0    string        5]    (Nine Men's Morris)
  6827. >>&0    string        6]    (Backgammon)
  6828. >>&0    string        7]    (Chinese chess)
  6829. >>&0    string        8]    (Shogi)
  6830. >>&0    string        9]    (Lines of Action)
  6831. >>&0    string        10]    (Ataxx)
  6832. >>&0    string        11]    (Hex)
  6833. >>&0    string        12]    (Jungle)
  6834. >>&0    string        13]    (Neutron)
  6835. >>&0    string        14]    (Philosopher's Football)
  6836. >>&0    string        15]    (Quadrature)
  6837. >>&0    string        16]    (Trax)
  6838. >>&0    string        17]    (Tantrix)
  6839. >>&0    string        18]    (Amazons)
  6840. >>&0    string        19]    (Octi)
  6841. >>&0    string        20]    (Gess)
  6842. >>&0    string        21]    (Twixt)
  6843. >>&0    string        22]    (Zertz)
  6844. >>&0    string        23]    (Plateau)
  6845. >>&0    string        24]    (Yinsh)
  6846. >>&0    string        25]    (Punct)
  6847. >>&0    string        26]    (Gobblet)
  6848. >>&0    string        27]    (hive)
  6849. >>&0    string        28]    (Exxit)
  6850. >>&0    string        29]    (Hnefatal)
  6851. >>&0    string        30]    (Kuba)
  6852. >>&0    string        31]    (Tripples)
  6853. >>&0    string        32]    (Chase)
  6854. >>&0    string        33]    (Tumbling Down)
  6855. >>&0    string        34]    (Sahara)
  6856. >>&0    string        35]    (Byte)
  6857. >>&0    string        36]    (Focus)
  6858. >>&0    string        37]    (Dvonn)
  6859. >>&0    string        38]    (Tamsk)
  6860. >>&0    string        39]    (Gipf)
  6861. >>&0    string        40]    (Kropki)
  6862.  
  6863.  
  6864. # Summary: Civilization 4 video
  6865. # Extension: .bik
  6866. # Created by: Abel Cheung <abelcheung@gmail.com>
  6867. 0    string    BIKi    Civilization 4 Video
  6868.  
  6869.  
  6870. ##############################################
  6871. # NetImmerse/Gamebryo game engine entries
  6872.  
  6873. # Summary: Gamebryo game engine file
  6874. # Extension: .nif, .kf
  6875. # Created by: Abel Cheung <abelcheung@gmail.com>
  6876. 0        string        Gamebryo\ File\ Format,\ Version\     Gamebryo game engine file
  6877. >&0        regex        [0-9a-z.]+                \b, version %s
  6878.  
  6879. # Summary: Gamebryo game engine file
  6880. # Extension: .kfm
  6881. # Created by: Abel Cheung <abelcheung@gmail.com>
  6882. 0        string        ;Gamebryo\ KFM\ File\ Version\         Gamebryo game engine animation File
  6883. >&0        regex        [0-9a-z.]+                \b, version %s
  6884.  
  6885. # Summary: NetImmerse game engine file
  6886. # Extension .nif
  6887. # Created by: Abel Cheung <abelcheung@gmail.com>
  6888. 0        string        NetImmerse\ File\ Format,\ Versio        
  6889. >&0        string        n\                     NetImmerse game engine file
  6890. >>&0        regex        [0-9a-z.]+                \b, version %s
  6891.  
  6892. # Type:    SGF Smart Game Format
  6893. # URL:    http://www.red-bean.com/sgf/
  6894. # From:    Eduardo Sabbatella <eduardo_sabbatella@yahoo.com.ar>
  6895. 2    regex/c    \\(;.*GM\\[[0-9]{1,2}\\]    Smart Game Format
  6896. >2    regex/c    GM\\[1\\]            - Go Game
  6897. >2    regex/c    GM\\[6\\]            - BackGammon Game
  6898. >2    regex/c    GM\\[11\\]            - Hex Game
  6899. >2    regex/c    GM\\[18\\]            - Amazons Game
  6900. >2    regex/c    GM\\[19\\]            - Octi Game
  6901. >2    regex/c    GM\\[20\\]            - Gess Game
  6902. >2    regex/c    GM\\[21\\]            - twix Game
  6903.  
  6904. #------------------------------------------------------------------------------
  6905. # gcc:  file(1) magic for GCC special files
  6906. #
  6907. 0    string        gpch        GCC precompiled header
  6908.  
  6909. # The version field is annoying.  It's 3 characters, not zero-terminated.
  6910. >5    byte        x            (version %c
  6911. >6    byte        x            \b%c
  6912. >7    byte        x            \b%c)
  6913.  
  6914. # 67 = 'C', 111 = 'o', 43 = '+', 79 = 'O'
  6915. >4    byte        67            for C
  6916. >4    byte        111            for Objective C
  6917. >4    byte        43            for C++
  6918. >4    byte        79            for Objective C++
  6919.  
  6920. #------------------------------------------------------------------------------
  6921. # GEOS files (Vidar Madsen, vidar@gimp.org)
  6922. # semi-commonly used in embedded and handheld systems.
  6923. 0    belong    0xc745c153    GEOS
  6924. >40    byte    1    executable
  6925. >40    byte    2    VMFile
  6926. >40    byte    3    binary
  6927. >40    byte    4    directory label
  6928. >40    byte    <1    unknown
  6929. >40    byte    >4    unknown
  6930. >4    string    >\0    \b, name "%s"
  6931. #>44    short    x    \b, version %d
  6932. #>46    short    x    \b.%d
  6933. #>48    short    x    \b, rev %d
  6934. #>50    short    x    \b.%d
  6935. #>52    short    x    \b, proto %d
  6936. #>54    short    x    \br%d
  6937. #>168    string    >\0    \b, copyright "%s"
  6938. #------------------------------------------------------------------------------
  6939. # GIMP Gradient: file(1) magic for the GIMP's gradient data files
  6940. # by Federico Mena <federico@nuclecu.unam.mx>
  6941.  
  6942. 0       string          GIMP\ Gradient  GIMP gradient data
  6943.  
  6944. #------------------------------------------------------------------------------
  6945. # XCF:  file(1) magic for the XCF image format used in the GIMP developed
  6946. #       by Spencer Kimball and Peter Mattis
  6947. #       ('Bucky' LaDieu, nega@vt.edu)
  6948.  
  6949. 0    string        gimp\ xcf    GIMP XCF image data,
  6950. !:mime    image/x-xcf
  6951. >9    string        file        version 0,
  6952. >9    string        v        version
  6953. >>10    string        >\0        %s,
  6954. >14    belong        x        %lu x
  6955. >18    belong        x        %lu,
  6956. >22     belong          0               RGB Color
  6957. >22     belong          1               Greyscale
  6958. >22     belong          2               Indexed Color
  6959. >22    belong        >2        Unknown Image Type.
  6960.  
  6961. #------------------------------------------------------------------------------
  6962. # XCF:  file(1) magic for the patterns used in the GIMP, developed
  6963. #       by Spencer Kimball and Peter Mattis
  6964. #       ('Bucky' LaDieu, nega@vt.edu)
  6965.  
  6966. 20      string          GPAT            GIMP pattern data,
  6967. >24     string          x               %s
  6968.  
  6969. #------------------------------------------------------------------------------
  6970. # XCF:  file(1) magic for the brushes used in the GIMP, developed
  6971. #       by Spencer Kimball and Peter Mattis
  6972. #       ('Bucky' LaDieu, nega@vt.edu)
  6973.  
  6974. 20      string          GIMP            GIMP brush data
  6975.  
  6976. # GIMP Curves File
  6977. # From: "Nelson A. de Oliveira" <naoliv@gmail.com>
  6978. 0    string    #\040GIMP\040Curves\040File    GIMP curve file
  6979. # GNOME keyring
  6980. # Contributed by Josh Triplett
  6981. # FIXME: Could be simplified if pstring supported two-byte counts
  6982. 0         string   GnomeKeyring\n\r\0\n GNOME keyring
  6983. >&0       ubyte    0                    \b, major version 0
  6984. >>&0      ubyte    0                    \b, minor version 0
  6985. >>>&0     ubyte    0                    \b, crypto type 0 (AEL)
  6986. >>>&0     ubyte    >0                   \b, crypto type %hhu (unknown)
  6987. >>>&1     ubyte    0                    \b, hash type 0 (MD5)
  6988. >>>&1     ubyte    >0                   \b, hash type %hhu (unknown)
  6989. >>>&2     ubelong  0xFFFFFFFF           \b, name NULL
  6990. >>>&2     ubelong  !0xFFFFFFFF
  6991. >>>>&-4   ubelong  >255                 \b, name too long for file's pstring type
  6992. >>>>&-4   ubelong  <256
  6993. >>>>>&-1  pstring  x                    \b, name "%s"
  6994. >>>>>>&0  ubeqdate x                    \b, last modified %s
  6995. >>>>>>&8  ubeqdate x                    \b, created %s
  6996. >>>>>>&16 ubelong  &1
  6997. >>>>>>>&0 ubelong  x                    \b, locked if idle for %u seconds
  6998. >>>>>>&16 ubelong  ^1                   \b, not locked if idle
  6999. >>>>>>&24 ubelong  x                    \b, hash iterations %u
  7000. >>>>>>&28 ubequad  x                    \b, salt %llu
  7001. >>>>>>&52 ubelong  x                    \b, %u item(s)
  7002. #------------------------------------------------------------------------------
  7003. # gnu:  file(1) magic for various GNU tools
  7004. #
  7005. # GNU nlsutils message catalog file format
  7006. #
  7007. 0    string        \336\22\4\225    GNU message catalog (little endian),
  7008. >4    lelong        x        revision %d,
  7009. >8    lelong        x        %d messages
  7010. 0    string        \225\4\22\336    GNU message catalog (big endian),
  7011. >4    belong        x        revision %d,
  7012. >8    belong        x        %d messages
  7013. # message catalogs, from Mitchum DSouza <m.dsouza@mrc-apu.cam.ac.uk>
  7014. 0    string        *nazgul*    Nazgul style compiled message catalog
  7015. >8    lelong        >0        \b, version %ld
  7016.  
  7017. # GnuPG
  7018. # The format is very similar to pgp
  7019. 0    string          \001gpg                 GPG key trust database
  7020. >4    byte            x                       version %d
  7021. # Note: magic.mime had 0x8501 for the next line instead of 0x8502
  7022. 0    beshort        0x8502            GPG encrypted data
  7023. !:mime    text/PGP # encoding: data
  7024.  
  7025. # This magic is not particularly good, as the keyrings don't have true
  7026. # magic. Nevertheless, it covers many keyrings.
  7027. 0       beshort         0x9901                  GPG key public ring
  7028. !:mime    application/x-gnupg-keyring
  7029.  
  7030. # Gnumeric spreadsheet
  7031. # This entry is only semi-helpful, as Gnumeric compresses its files, so
  7032. # they will ordinarily reported as "compressed", but at least -z helps
  7033. 39      string          =<gmr:Workbook           Gnumeric spreadsheet
  7034.  
  7035. # From: James Youngman <jay@gnu.org> 
  7036. # gnu find magic
  7037. 0    string    \0LOCATE    GNU findutils locate database data
  7038. >7    string    >\0        \b, format %s
  7039. >7    string    02        \b (frcode)
  7040.  
  7041. # Files produced by GNU gettext
  7042. 0    long    0xDE120495        GNU-format message catalog data
  7043. 0    long    0x950412DE        GNU-format message catalog data
  7044.  
  7045. #------------------------------------------------------------------------------
  7046. # gnumeric:  file(1) magic for Gnumeric spreadsheet
  7047. # This entry is only semi-helpful, as Gnumeric compresses its files, so
  7048. # they will ordinarily reported as "compressed", but at least -z helps
  7049. 39    string    =<gmr:Workbook    Gnumeric spreadsheet
  7050. !:mime    application/x-gnumeric
  7051.  
  7052. #------------------------------------------------------------------------------
  7053. # ACE/gr and Grace type files - PLEASE DO NOT REMOVE THIS LINE
  7054. #
  7055. # ACE/gr binary
  7056. 0    string    \000\000\0001\000\000\0000\000\000\0000\000\000\0002\000\000\0000\000\000\0000\000\000\0003        old ACE/gr binary file
  7057. >39    byte    >0            - version %c
  7058. # ACE/gr ascii
  7059. 0    string    #\ xvgr\ parameter\ file    ACE/gr ascii file
  7060. 0    string    #\ xmgr\ parameter\ file    ACE/gr ascii file
  7061. 0    string    #\ ACE/gr\ parameter\ file    ACE/gr ascii file
  7062. # Grace projects
  7063. 0    string    #\ Grace\ project\ file        Grace project file
  7064. >23    string    @version\              (version
  7065. >>32    byte    >0                 %c
  7066. >>33    string    >\0                 \b.%.2s
  7067. >>35    string    >\0                 \b.%.2s)
  7068. # ACE/gr fit description files
  7069. 0    string    #\ ACE/gr\ fit\ description\     ACE/gr fit description file
  7070. # end of ACE/gr and Grace type files - PLEASE DO NOT REMOVE THIS LINE
  7071.  
  7072. #------------------------------------------------------------------------------
  7073. # graphviz:  file(1) magic for http://www.graphviz.org/
  7074. 0    regex/100    [\r\n\t\ ]*graph[\r\n\t\ ]*.*\\{    graphviz graph text
  7075. !:mime    text/vnd.graphviz
  7076. 0    regex/100    [\r\n\t\ ]*digraph[\r\n\t\ ]*.*\\{    graphviz digraph text
  7077. !:mime    text/vnd.graphviz
  7078.  
  7079. #------------------------------------------------------------------------------
  7080. # gringotts:  file(1) magic for Gringotts
  7081. # http://devel.pluto.linux.it/projects/Gringotts/
  7082. # author: Germano Rizzo <mano@pluto.linux.it>
  7083. #GRG3????Y
  7084. 0    string    GRG        Gringotts data file
  7085. #file format 1
  7086. >3    string        1        v.1, MCRYPT S2K, SERPENT crypt, SHA-256 hash, ZLib lvl.9
  7087. #file format 2
  7088. >3    string        2        v.2, MCRYPT S2K, 
  7089. >>8    byte&0x70    0x00        RIJNDAEL-128 crypt,
  7090. >>8    byte&0x70    0x10        SERPENT crypt,
  7091. >>8    byte&0x70    0x20        TWOFISH crypt, 
  7092. >>8    byte&0x70    0x30        CAST-256 crypt,
  7093. >>8    byte&0x70    0x40        SAFER+ crypt,
  7094. >>8    byte&0x70    0x50        LOKI97 crypt,
  7095. >>8    byte&0x70    0x60        3DES crypt,
  7096. >>8    byte&0x70    0x70        RIJNDAEL-256 crypt,
  7097. >>8    byte&0x08    0x00        SHA1 hash,
  7098. >>8    byte&0x08    0x08        RIPEMD-160 hash,
  7099. >>8    byte&0x04    0x00        ZLib
  7100. >>8    byte&0x04    0x04        BZip2
  7101. >>8    byte&0x03    0x00        lvl.0
  7102. >>8    byte&0x03    0x01        lvl.3
  7103. >>8    byte&0x03    0x02        lvl.6
  7104. >>8    byte&0x03    0x03        lvl.9
  7105. #file format 3
  7106. >3    string        3        v.3, OpenPGP S2K, 
  7107. >>8    byte&0x70    0x00        RIJNDAEL-128 crypt,
  7108. >>8    byte&0x70    0x10        SERPENT crypt,
  7109. >>8    byte&0x70    0x20        TWOFISH crypt, 
  7110. >>8    byte&0x70    0x30        CAST-256 crypt,
  7111. >>8    byte&0x70    0x40        SAFER+ crypt,
  7112. >>8    byte&0x70    0x50        LOKI97 crypt,
  7113. >>8    byte&0x70    0x60        3DES crypt,
  7114. >>8    byte&0x70    0x70        RIJNDAEL-256 crypt,
  7115. >>8    byte&0x08    0x00        SHA1 hash,
  7116. >>8    byte&0x08    0x08        RIPEMD-160 hash,
  7117. >>8    byte&0x04    0x00        ZLib
  7118. >>8    byte&0x04    0x04        BZip2
  7119. >>8    byte&0x03    0x00        lvl.0
  7120. >>8    byte&0x03    0x01        lvl.3
  7121. >>8    byte&0x03    0x02        lvl.6
  7122. >>8    byte&0x03    0x03        lvl.9
  7123. #file format >3
  7124. >3    string        >3        v.%.1s (unknown details)
  7125.  
  7126. #------------------------------------------------------------------------------
  7127. # hitach-sh: file(1) magic for Hitachi Super-H
  7128. #
  7129. # Super-H COFF
  7130. #
  7131. 0    beshort        0x0500        Hitachi SH big-endian COFF
  7132. >18    beshort&0x0002    =0x0000        object
  7133. >18    beshort&0x0002    =0x0002        executable
  7134. >18    beshort&0x0008    =0x0008        \b, stripped
  7135. >18    beshort&0x0008    =0x0000        \b, not stripped
  7136. #
  7137. 0    leshort        0x0550        Hitachi SH little-endian COFF
  7138. >18    leshort&0x0002    =0x0000        object
  7139. >18    leshort&0x0002    =0x0002        executable
  7140. >18    leshort&0x0008    =0x0008        \b, stripped
  7141. >18    leshort&0x0008    =0x0000        \b, not stripped
  7142.  
  7143. #------------------------------------------------------------------------------
  7144. # hp:  file(1) magic for Hewlett Packard machines (see also "printer")
  7145. #
  7146. # XXX - somebody should figure out whether any byte order needs to be
  7147. # applied to the "TML" stuff; I'm assuming the Apollo stuff is
  7148. # big-endian as it was mostly 68K-based.
  7149. #
  7150. # I think the 500 series was the old stack-based machines, running a
  7151. # UNIX environment atop the "SUN kernel"; dunno whether it was
  7152. # big-endian or little-endian.
  7153. #
  7154. # Daniel Quinlan (quinlan@yggdrasil.com): hp200 machines are 68010 based;
  7155. # hp300 are 68020+68881 based; hp400 are also 68k.  The following basic
  7156. # HP magic is useful for reference, but using "long" magic is a better
  7157. # practice in order to avoid collisions.
  7158. #
  7159. # Guy Harris (guy@netapp.com): some additions to this list came from
  7160. # HP-UX 10.0's "/usr/include/sys/unistd.h" (68030, 68040, PA-RISC 1.1,
  7161. # 1.2, and 2.0).  The 1.2 and 2.0 stuff isn't in the HP-UX 10.0
  7162. # "/etc/magic", though, except for the "archive file relocatable library"
  7163. # stuff, and the 68030 and 68040 stuff isn't there at all - are they not
  7164. # used in executables, or have they just not yet updated "/etc/magic"
  7165. # completely?
  7166. #
  7167. # 0    beshort        200        hp200 (68010) BSD binary
  7168. # 0    beshort        300        hp300 (68020+68881) BSD binary
  7169. # 0    beshort        0x20c        hp200/300 HP-UX binary
  7170. # 0    beshort        0x20d        hp400 (68030) HP-UX binary
  7171. # 0    beshort        0x20e        hp400 (68040?) HP-UX binary
  7172. # 0    beshort        0x20b        PA-RISC1.0 HP-UX binary
  7173. # 0    beshort        0x210        PA-RISC1.1 HP-UX binary
  7174. # 0    beshort        0x211        PA-RISC1.2 HP-UX binary
  7175. # 0    beshort        0x214        PA-RISC2.0 HP-UX binary
  7176.  
  7177. #
  7178. # The "misc" stuff needs a byte order; the archives look suspiciously
  7179. # like the old 177545 archives (0xff65 = 0177545).
  7180. #
  7181. #### Old Apollo stuff
  7182. 0    beshort        0627        Apollo m68k COFF executable
  7183. >18    beshort        ^040000        not stripped
  7184. >22    beshort        >0        - version %ld
  7185. 0    beshort        0624        apollo a88k COFF executable
  7186. >18    beshort        ^040000        not stripped
  7187. >22    beshort        >0        - version %ld
  7188. 0       long            01203604016     TML 0123 byte-order format
  7189. 0       long            01702407010     TML 1032 byte-order format
  7190. 0       long            01003405017     TML 2301 byte-order format
  7191. 0       long            01602007412     TML 3210 byte-order format
  7192. #### PA-RISC 1.1
  7193. 0    belong         0x02100106    PA-RISC1.1 relocatable object
  7194. 0    belong         0x02100107    PA-RISC1.1 executable
  7195. >168    belong        &0x00000004    dynamically linked
  7196. >(144)    belong        0x054ef630    dynamically linked
  7197. >96    belong        >0        - not stripped
  7198.  
  7199. 0    belong         0x02100108    PA-RISC1.1 shared executable
  7200. >168    belong&0x4    0x4        dynamically linked
  7201. >(144)    belong        0x054ef630    dynamically linked
  7202. >96    belong        >0        - not stripped
  7203.  
  7204. 0    belong         0x0210010b    PA-RISC1.1 demand-load executable
  7205. >168    belong&0x4    0x4        dynamically linked
  7206. >(144)    belong        0x054ef630    dynamically linked
  7207. >96    belong        >0        - not stripped
  7208.  
  7209. 0    belong         0x0210010e    PA-RISC1.1 shared library
  7210. >96    belong        >0        - not stripped
  7211.  
  7212. 0    belong         0x0210010d    PA-RISC1.1 dynamic load library
  7213. >96    belong        >0        - not stripped
  7214.  
  7215. #### PA-RISC 2.0
  7216. 0    belong        0x02140106    PA-RISC2.0 relocatable object
  7217.  
  7218. 0       belong        0x02140107    PA-RISC2.0 executable
  7219. >168    belong        &0x00000004    dynamically linked
  7220. >(144)    belong        0x054ef630    dynamically linked
  7221. >96    belong        >0        - not stripped
  7222.  
  7223. 0       belong        0x02140108    PA-RISC2.0 shared executable
  7224. >168    belong        &0x00000004    dynamically linked
  7225. >(144)    belong        0x054ef630    dynamically linked
  7226. >96    belong        >0        - not stripped
  7227.  
  7228. 0       belong        0x0214010b    PA-RISC2.0 demand-load executable
  7229. >168    belong        &0x00000004    dynamically linked
  7230. >(144)    belong        0x054ef630    dynamically linked
  7231. >96    belong        >0        - not stripped
  7232.  
  7233. 0       belong        0x0214010e    PA-RISC2.0 shared library
  7234. >96    belong        >0        - not stripped
  7235.  
  7236. 0       belong        0x0214010d    PA-RISC2.0 dynamic load library
  7237. >96    belong        >0        - not stripped
  7238.  
  7239. #### 800
  7240. 0    belong         0x020b0106    PA-RISC1.0 relocatable object
  7241.  
  7242. 0    belong         0x020b0107    PA-RISC1.0 executable
  7243. >168    belong&0x4    0x4        dynamically linked
  7244. >(144)    belong        0x054ef630    dynamically linked
  7245. >96    belong        >0        - not stripped
  7246.  
  7247. 0    belong         0x020b0108    PA-RISC1.0 shared executable
  7248. >168    belong&0x4    0x4        dynamically linked
  7249. >(144)    belong        0x054ef630    dynamically linked
  7250. >96    belong        >0        - not stripped
  7251.  
  7252. 0    belong         0x020b010b    PA-RISC1.0 demand-load executable
  7253. >168    belong&0x4    0x4        dynamically linked
  7254. >(144)    belong        0x054ef630    dynamically linked
  7255. >96    belong        >0        - not stripped
  7256.  
  7257. 0    belong         0x020b010e    PA-RISC1.0 shared library
  7258. >96    belong        >0        - not stripped
  7259.  
  7260. 0    belong         0x020b010d    PA-RISC1.0 dynamic load library
  7261. >96    belong        >0        - not stripped
  7262.  
  7263. 0    belong        0x213c6172    archive file
  7264. >68    belong         0x020b0619    - PA-RISC1.0 relocatable library
  7265. >68    belong         0x02100619    - PA-RISC1.1 relocatable library
  7266. >68    belong         0x02110619    - PA-RISC1.2 relocatable library
  7267. >68    belong         0x02140619    - PA-RISC2.0 relocatable library
  7268.  
  7269. #### 500
  7270. 0    long        0x02080106    HP s500 relocatable executable
  7271. >16    long        >0        - version %ld
  7272.  
  7273. 0    long        0x02080107    HP s500 executable
  7274. >16    long        >0        - version %ld
  7275.  
  7276. 0    long        0x02080108    HP s500 pure executable
  7277. >16    long        >0        - version %ld
  7278.  
  7279. #### 200
  7280. 0    belong         0x020c0108    HP s200 pure executable
  7281. >4    beshort        >0        - version %ld
  7282. >8    belong        &0x80000000    save fp regs
  7283. >8    belong        &0x40000000    dynamically linked
  7284. >8    belong        &0x20000000    debuggable
  7285. >36    belong        >0        not stripped
  7286.  
  7287. 0    belong        0x020c0107    HP s200 executable
  7288. >4    beshort        >0        - version %ld
  7289. >8    belong        &0x80000000    save fp regs
  7290. >8    belong        &0x40000000    dynamically linked
  7291. >8    belong        &0x20000000    debuggable
  7292. >36    belong        >0        not stripped
  7293.  
  7294. 0    belong        0x020c010b    HP s200 demand-load executable
  7295. >4    beshort        >0        - version %ld
  7296. >8    belong        &0x80000000    save fp regs
  7297. >8    belong        &0x40000000    dynamically linked
  7298. >8    belong        &0x20000000    debuggable
  7299. >36    belong        >0        not stripped
  7300.  
  7301. 0    belong        0x020c0106    HP s200 relocatable executable
  7302. >4    beshort        >0        - version %ld
  7303. >6    beshort        >0        - highwater %d
  7304. >8    belong        &0x80000000    save fp regs
  7305. >8    belong        &0x20000000    debuggable
  7306. >8    belong        &0x10000000    PIC
  7307.  
  7308. 0    belong         0x020a0108    HP s200 (2.x release) pure executable
  7309. >4    beshort        >0        - version %ld
  7310. >36    belong        >0        not stripped
  7311.  
  7312. 0    belong        0x020a0107    HP s200 (2.x release) executable
  7313. >4    beshort        >0        - version %ld
  7314. >36    belong        >0        not stripped
  7315.  
  7316. 0    belong        0x020c010e    HP s200 shared library
  7317. >4    beshort        >0        - version %ld
  7318. >6    beshort        >0        - highwater %d
  7319. >36    belong        >0        not stripped
  7320.  
  7321. 0    belong        0x020c010d    HP s200 dynamic load library
  7322. >4    beshort        >0        - version %ld
  7323. >6    beshort        >0        - highwater %d
  7324. >36    belong        >0        not stripped
  7325.  
  7326. #### MISC
  7327. 0    long        0x0000ff65    HP old archive
  7328. 0    long        0x020aff65    HP s200 old archive
  7329. 0    long        0x020cff65    HP s200 old archive
  7330. 0    long        0x0208ff65    HP s500 old archive
  7331.  
  7332. 0    long        0x015821a6    HP core file
  7333.  
  7334. 0    long        0x4da7eee8    HP-WINDOWS font
  7335. >8    byte        >0        - version %ld
  7336. 0    string        Bitmapfile    HP Bitmapfile
  7337.  
  7338. 0    string        IMGfile    CIS     compimg HP Bitmapfile
  7339. # XXX - see "lif"
  7340. #0    short        0x8000        lif file
  7341. 0    long        0x020c010c    compiled Lisp
  7342.  
  7343. 0    string        msgcat01    HP NLS message catalog,
  7344. >8    long        >0        %d messages
  7345.  
  7346. # Summary: HP-48/49 calculator
  7347. # Created by: phk@data.fls.dk
  7348. # Modified by (1): AMAKAWA Shuhei <sa264@cam.ac.uk>
  7349. # Modified by (2): Samuel Thibault <samuel.thibault@ens-lyon.org> (HP49 support)
  7350. 0    string        HPHP        HP
  7351. >4    string        48        48 binary
  7352. >4    string        49        49 binary
  7353. >7    byte        >64        - Rev %c
  7354. >8    leshort        0x2911        (ADR)
  7355. >8    leshort        0x2933        (REAL)
  7356. >8    leshort        0x2955        (LREAL)
  7357. >8    leshort        0x2977        (COMPLX)
  7358. >8    leshort        0x299d        (LCOMPLX)
  7359. >8    leshort        0x29bf        (CHAR)
  7360. >8    leshort        0x29e8        (ARRAY)
  7361. >8    leshort        0x2a0a        (LNKARRAY)
  7362. >8    leshort        0x2a2c        (STRING)
  7363. >8    leshort        0x2a4e        (HXS)
  7364. >8    leshort        0x2a74        (LIST)
  7365. >8    leshort        0x2a96        (DIR)
  7366. >8    leshort        0x2ab8        (ALG)
  7367. >8    leshort        0x2ada        (UNIT)
  7368. >8    leshort        0x2afc        (TAGGED)
  7369. >8    leshort        0x2b1e        (GROB)
  7370. >8    leshort        0x2b40        (LIB)
  7371. >8    leshort        0x2b62        (BACKUP)
  7372. >8    leshort        0x2b88        (LIBDATA)
  7373. >8    leshort        0x2d9d        (PROG)
  7374. >8    leshort        0x2dcc        (CODE)
  7375. >8    leshort        0x2e48        (GNAME)
  7376. >8    leshort        0x2e6d        (LNAME)
  7377. >8    leshort        0x2e92        (XLIB)
  7378.  
  7379. 0    string        %%HP:        HP text
  7380. >6    string        T(0)        - T(0)
  7381. >6    string        T(1)        - T(1)
  7382. >6    string        T(2)        - T(2)
  7383. >6    string        T(3)        - T(3)
  7384. >10    string        A(D)        A(D)
  7385. >10    string        A(R)        A(R)
  7386. >10    string        A(G)        A(G)
  7387. >14    string        F(.)        F(.);
  7388. >14    string        F(,)        F(,);
  7389.  
  7390.  
  7391. # Summary: HP-38/39 calculator
  7392. # Created by: Samuel Thibault <samuel.thibault@ens-lyon.org>
  7393. 0    string        HP3
  7394. >3    string        8        HP 38
  7395. >3    string        9        HP 39
  7396. >4    string        Bin        binary
  7397. >4    string        Asc        ASCII
  7398. >7    string        A        (Directory List)
  7399. >7    string        B        (Zaplet)
  7400. >7    string        C        (Note)
  7401. >7    string        D        (Program)
  7402. >7    string        E        (Variable)
  7403. >7    string        F        (List)
  7404. >7    string        G        (Matrix)
  7405. >7    string        H        (Library)
  7406. >7    string        I        (Target List)
  7407. >7    string        J        (ASCII Vector specification)
  7408. >7    string        K        (wildcard)
  7409.  
  7410. # Summary: HP-38/39 calculator
  7411. # Created by: Samuel Thibault <samuel.thibault@ens-lyon.org>
  7412. 0    string        HP3
  7413. >3    string        8        HP 38
  7414. >3    string        9        HP 39
  7415. >4    string        Bin        binary
  7416. >4    string        Asc        ASCII
  7417. >7    string        A        (Directory List)
  7418. >7    string        B        (Zaplet)
  7419. >7    string        C        (Note)
  7420. >7    string        D        (Program)
  7421. >7    string        E        (Variable)
  7422. >7    string        F        (List)
  7423. >7    string        G        (Matrix)
  7424. >7    string        H        (Library)
  7425. >7    string        I        (Target List)
  7426. >7    string        J        (ASCII Vector specification)
  7427. >7    string        K        (wildcard)
  7428.  
  7429. # hpBSD magic numbers
  7430. 0    beshort        200        hp200 (68010) BSD
  7431. >2    beshort        0407        impure binary
  7432. >2    beshort        0410        read-only binary
  7433. >2    beshort        0413        demand paged binary
  7434. 0    beshort        300        hp300 (68020+68881) BSD
  7435. >2    beshort        0407        impure binary
  7436. >2    beshort        0410        read-only binary
  7437. >2    beshort        0413        demand paged binary
  7438. #
  7439. # From David Gero <dgero@nortelnetworks.com>
  7440. # HP-UX 10.20 core file format from /usr/include/sys/core.h
  7441. # Unfortunately, HP-UX uses corehead blocks without specifying the order
  7442. # There are four we care about:
  7443. #     CORE_KERNEL, which starts with the string "HP-UX"
  7444. #     CORE_EXEC, which contains the name of the command
  7445. #     CORE_PROC, which contains the signal number that caused the core dump
  7446. #     CORE_FORMAT, which contains the version of the core file format (== 1)
  7447. # The only observed order in real core files is KERNEL, EXEC, FORMAT, PROC
  7448. # but we include all 6 variations of the order of the first 3, and
  7449. # assume that PROC will always be last
  7450. # Order 1: KERNEL, EXEC, FORMAT, PROC
  7451. 0x10        string    HP-UX
  7452. >0        belong    2
  7453. >>0xC        belong    0x3C
  7454. >>>0x4C        belong    0x100
  7455. >>>>0x58    belong    0x44
  7456. >>>>>0xA0    belong    1
  7457. >>>>>>0xAC    belong    4
  7458. >>>>>>>0xB0    belong    1
  7459. >>>>>>>>0xB4    belong    4        core file
  7460. >>>>>>>>>0x90    string    >\0        from '%s'
  7461. >>>>>>>>>0xC4    belong    3        - received SIGQUIT
  7462. >>>>>>>>>0xC4    belong    4        - received SIGILL
  7463. >>>>>>>>>0xC4    belong    5        - received SIGTRAP
  7464. >>>>>>>>>0xC4    belong    6        - received SIGABRT
  7465. >>>>>>>>>0xC4    belong    7        - received SIGEMT
  7466. >>>>>>>>>0xC4    belong    8        - received SIGFPE
  7467. >>>>>>>>>0xC4    belong    10        - received SIGBUS
  7468. >>>>>>>>>0xC4    belong    11        - received SIGSEGV
  7469. >>>>>>>>>0xC4    belong    12        - received SIGSYS
  7470. >>>>>>>>>0xC4    belong    33        - received SIGXCPU
  7471. >>>>>>>>>0xC4    belong    34        - received SIGXFSZ
  7472. # Order 2: KERNEL, FORMAT, EXEC, PROC
  7473. >>>0x4C        belong    1
  7474. >>>>0x58    belong    4
  7475. >>>>>0x5C    belong    1
  7476. >>>>>>0x60    belong    0x100
  7477. >>>>>>>0x6C    belong    0x44
  7478. >>>>>>>>0xB4    belong    4        core file
  7479. >>>>>>>>>0xA4    string    >\0        from '%s'
  7480. >>>>>>>>>0xC4    belong    3        - received SIGQUIT
  7481. >>>>>>>>>0xC4    belong    4        - received SIGILL
  7482. >>>>>>>>>0xC4    belong    5        - received SIGTRAP
  7483. >>>>>>>>>0xC4    belong    6        - received SIGABRT
  7484. >>>>>>>>>0xC4    belong    7        - received SIGEMT
  7485. >>>>>>>>>0xC4    belong    8        - received SIGFPE
  7486. >>>>>>>>>0xC4    belong    10        - received SIGBUS
  7487. >>>>>>>>>0xC4    belong    11        - received SIGSEGV
  7488. >>>>>>>>>0xC4    belong    12        - received SIGSYS
  7489. >>>>>>>>>0xC4    belong    33        - received SIGXCPU
  7490. >>>>>>>>>0xC4    belong    34        - received SIGXFSZ
  7491. # Order 3: FORMAT, KERNEL, EXEC, PROC
  7492. 0x24        string    HP-UX
  7493. >0        belong    1
  7494. >>0xC        belong    4
  7495. >>>0x10        belong    1
  7496. >>>>0x14    belong    2
  7497. >>>>>0x20    belong    0x3C
  7498. >>>>>>0x60    belong    0x100
  7499. >>>>>>>0x6C    belong    0x44
  7500. >>>>>>>>0xB4    belong    4        core file
  7501. >>>>>>>>>0xA4    string    >\0        from '%s'
  7502. >>>>>>>>>0xC4    belong    3        - received SIGQUIT
  7503. >>>>>>>>>0xC4    belong    4        - received SIGILL
  7504. >>>>>>>>>0xC4    belong    5        - received SIGTRAP
  7505. >>>>>>>>>0xC4    belong    6        - received SIGABRT
  7506. >>>>>>>>>0xC4    belong    7        - received SIGEMT
  7507. >>>>>>>>>0xC4    belong    8        - received SIGFPE
  7508. >>>>>>>>>0xC4    belong    10        - received SIGBUS
  7509. >>>>>>>>>0xC4    belong    11        - received SIGSEGV
  7510. >>>>>>>>>0xC4    belong    12        - received SIGSYS
  7511. >>>>>>>>>0xC4    belong    33        - received SIGXCPU
  7512. >>>>>>>>>0xC4    belong    34        - received SIGXFSZ
  7513. # Order 4: EXEC, KERNEL, FORMAT, PROC
  7514. 0x64        string    HP-UX
  7515. >0        belong    0x100
  7516. >>0xC        belong    0x44
  7517. >>>0x54        belong    2
  7518. >>>>0x60    belong    0x3C
  7519. >>>>>0xA0    belong    1
  7520. >>>>>>0xAC    belong    4
  7521. >>>>>>>0xB0    belong    1
  7522. >>>>>>>>0xB4    belong    4        core file
  7523. >>>>>>>>>0x44    string    >\0        from '%s'
  7524. >>>>>>>>>0xC4    belong    3        - received SIGQUIT
  7525. >>>>>>>>>0xC4    belong    4        - received SIGILL
  7526. >>>>>>>>>0xC4    belong    5        - received SIGTRAP
  7527. >>>>>>>>>0xC4    belong    6        - received SIGABRT
  7528. >>>>>>>>>0xC4    belong    7        - received SIGEMT
  7529. >>>>>>>>>0xC4    belong    8        - received SIGFPE
  7530. >>>>>>>>>0xC4    belong    10        - received SIGBUS
  7531. >>>>>>>>>0xC4    belong    11        - received SIGSEGV
  7532. >>>>>>>>>0xC4    belong    12        - received SIGSYS
  7533. >>>>>>>>>0xC4    belong    33        - received SIGXCPU
  7534. >>>>>>>>>0xC4    belong    34        - received SIGXFSZ
  7535. # Order 5: FORMAT, EXEC, KERNEL, PROC
  7536. 0x78        string    HP-UX
  7537. >0        belong    1
  7538. >>0xC        belong    4
  7539. >>>0x10        belong    1
  7540. >>>>0x14    belong    0x100
  7541. >>>>>0x20    belong    0x44
  7542. >>>>>>0x68    belong    2
  7543. >>>>>>>0x74    belong    0x3C
  7544. >>>>>>>>0xB4    belong    4        core file
  7545. >>>>>>>>>0x58    string    >\0        from '%s'
  7546. >>>>>>>>>0xC4    belong    3        - received SIGQUIT
  7547. >>>>>>>>>0xC4    belong    4        - received SIGILL
  7548. >>>>>>>>>0xC4    belong    5        - received SIGTRAP
  7549. >>>>>>>>>0xC4    belong    6        - received SIGABRT
  7550. >>>>>>>>>0xC4    belong    7        - received SIGEMT
  7551. >>>>>>>>>0xC4    belong    8        - received SIGFPE
  7552. >>>>>>>>>0xC4    belong    10        - received SIGBUS
  7553. >>>>>>>>>0xC4    belong    11        - received SIGSEGV
  7554. >>>>>>>>>0xC4    belong    12        - received SIGSYS
  7555. >>>>>>>>>0xC4    belong    33        - received SIGXCPU
  7556. >>>>>>>>>0xC4    belong    34        - received SIGXFSZ
  7557. # Order 6: EXEC, FORMAT, KERNEL, PROC
  7558. >0        belong    0x100
  7559. >>0xC        belong    0x44
  7560. >>>0x54        belong    1
  7561. >>>>0x60    belong    4
  7562. >>>>>0x64    belong    1
  7563. >>>>>>0x68    belong    2
  7564. >>>>>>>0x74    belong    0x2C
  7565. >>>>>>>>0xB4    belong    4        core file
  7566. >>>>>>>>>0x44    string    >\0        from '%s'
  7567. >>>>>>>>>0xC4    belong    3        - received SIGQUIT
  7568. >>>>>>>>>0xC4    belong    4        - received SIGILL
  7569. >>>>>>>>>0xC4    belong    5        - received SIGTRAP
  7570. >>>>>>>>>0xC4    belong    6        - received SIGABRT
  7571. >>>>>>>>>0xC4    belong    7        - received SIGEMT
  7572. >>>>>>>>>0xC4    belong    8        - received SIGFPE
  7573. >>>>>>>>>0xC4    belong    10        - received SIGBUS
  7574. >>>>>>>>>0xC4    belong    11        - received SIGSEGV
  7575. >>>>>>>>>0xC4    belong    12        - received SIGSYS
  7576. >>>>>>>>>0xC4    belong    33        - received SIGXCPU
  7577. >>>>>>>>>0xC4    belong    34        - received SIGXFSZ
  7578.  
  7579.  
  7580.  
  7581. #------------------------------------------------------------------------------
  7582. # human68k:  file(1) magic for Human68k (X680x0 DOS) binary formats
  7583. # Magic too short!
  7584. #0        string    HU        Human68k
  7585. #>68        string    LZX        LZX compressed
  7586. #>>72        string    >\0        (version %s)
  7587. #>(8.L+74)    string    LZX        LZX compressed
  7588. #>>(8.L+78)    string    >\0        (version %s)
  7589. #>60        belong    >0        binded
  7590. #>(8.L+66)    string    #HUPAIR        hupair
  7591. #>0        string    HU        X executable
  7592. #>(8.L+74)    string    #LIBCV1        - linked PD LIBC ver 1
  7593. #>4        belong    >0        - base address 0x%x
  7594. #>28        belong    >0        not stripped
  7595. #>32        belong    >0        with debug information
  7596. #0        beshort    0x601a        Human68k Z executable
  7597. #0        beshort    0x6000        Human68k object file
  7598. #0        belong    0xd1000000    Human68k ar binary archive
  7599. #0        belong    0xd1010000    Human68k ar ascii archive
  7600. #0        beshort    0x0068        Human68k lib archive
  7601. #4        string    LZX        Human68k LZX compressed
  7602. #>8        string    >\0        (version %s)
  7603. #>4        string    LZX        R executable
  7604. #2        string    #HUPAIR        Human68k hupair R executable
  7605.  
  7606. #------------------------------------------------------------------------------
  7607. # ibm370:  file(1) magic for IBM 370 and compatibles.
  7608. #
  7609. # "ibm370" said that 0x15d == 0535 was "ibm 370 pure executable".
  7610. # What the heck *is* "USS/370"?
  7611. # AIX 4.1's "/etc/magic" has
  7612. #
  7613. #    0    short        0535        370 sysV executable 
  7614. #    >12    long        >0        not stripped
  7615. #    >22    short        >0        - version %d
  7616. #    >30    long        >0        - 5.2 format
  7617. #    0    short        0530        370 sysV pure executable 
  7618. #    >12    long        >0        not stripped
  7619. #    >22    short        >0        - version %d
  7620. #    >30    long        >0        - 5.2 format
  7621. #
  7622. # instead of the "USS/370" versions of the same magic numbers.
  7623. #
  7624. 0    beshort        0537        370 XA sysV executable 
  7625. >12    belong        >0        not stripped
  7626. >22    beshort        >0        - version %d
  7627. >30    belong        >0        - 5.2 format
  7628. 0    beshort        0532        370 XA sysV pure executable 
  7629. >12    belong        >0        not stripped
  7630. >22    beshort        >0        - version %d
  7631. >30    belong        >0        - 5.2 format
  7632. 0    beshort        054001        370 sysV pure executable
  7633. >12    belong        >0        not stripped
  7634. 0    beshort        055001        370 XA sysV pure executable
  7635. >12    belong        >0        not stripped
  7636. 0    beshort        056401        370 sysV executable
  7637. >12    belong        >0        not stripped
  7638. 0    beshort        057401        370 XA sysV executable
  7639. >12    belong        >0        not stripped
  7640. 0       beshort        0531        SVR2 executable (Amdahl-UTS)
  7641. >12    belong        >0        not stripped
  7642. >24     belong        >0        - version %ld
  7643. 0    beshort        0534        SVR2 pure executable (Amdahl-UTS)
  7644. >12    belong        >0        not stripped
  7645. >24    belong        >0        - version %ld
  7646. 0    beshort        0530        SVR2 pure executable (USS/370)
  7647. >12    belong        >0        not stripped
  7648. >24    belong        >0        - version %ld
  7649. 0    beshort        0535        SVR2 executable (USS/370)
  7650. >12    belong        >0        not stripped
  7651. >24    belong        >0        - version %ld
  7652.  
  7653. #------------------------------------------------------------------------------
  7654. # ibm6000:  file(1) magic for RS/6000 and the RT PC.
  7655. #
  7656. 0    beshort        0x01df        executable (RISC System/6000 V3.1) or obj module
  7657. >12    belong        >0        not stripped
  7658. # Breaks sun4 statically linked execs.
  7659. #0      beshort        0x0103        executable (RT Version 2) or obj module
  7660. #>2    byte        0x50        pure
  7661. #>28    belong        >0        not stripped
  7662. #>6    beshort        >0        - version %ld
  7663. 0    beshort        0x0104        shared library
  7664. 0    beshort        0x0105        ctab data
  7665. 0    beshort        0xfe04        structured file
  7666. 0    string        0xabcdef    AIX message catalog
  7667. 0    belong        0x000001f9    AIX compiled message catalog
  7668. 0    string        \<aiaff>    archive
  7669. 0    string        \<bigaf>    archive (big format)
  7670.  
  7671.  
  7672. #------------------------------------------------------------------------------
  7673. # iff:    file(1) magic for Interchange File Format (see also "audio" & "images")
  7674. #
  7675. # Daniel Quinlan (quinlan@yggdrasil.com) -- IFF was designed by Electronic
  7676. # Arts for file interchange.  It has also been used by Apple, SGI, and
  7677. # especially Commodore-Amiga.
  7678. #
  7679. # IFF files begin with an 8 byte FORM header, followed by a 4 character
  7680. # FORM type, which is followed by the first chunk in the FORM.
  7681.  
  7682. 0    string        FORM        IFF data
  7683. #>4    belong        x        \b, FORM is %d bytes long
  7684. # audio formats
  7685. >8    string        AIFF        \b, AIFF audio
  7686. !:mime    audio/x-aiff
  7687. >8    string        AIFC        \b, AIFF-C compressed audio
  7688. !:mime    audio/x-aiff
  7689. >8    string        8SVX        \b, 8SVX 8-bit sampled sound voice
  7690. !:mime    audio/x-aiff
  7691. >8    string        16SV        \b, 16SV 16-bit sampled sound voice
  7692. >8    string        SAMP        \b, SAMP sampled audio
  7693. >8    string        MAUD        \b, MAUD MacroSystem audio
  7694. >8    string        SMUS        \b, SMUS simple music
  7695. >8    string        CMUS        \b, CMUS complex music
  7696. # image formats
  7697. >8    string        ILBMBMHD    \b, ILBM interleaved image
  7698. >>20    beshort        x        \b, %d x
  7699. >>22    beshort        x        %d
  7700. >8    string        RGBN        \b, RGBN 12-bit RGB image
  7701. >8    string        RGB8        \b, RGB8 24-bit RGB image
  7702. >8    string        DEEP        \b, DEEP TVPaint/XiPaint image
  7703. >8    string        DR2D        \b, DR2D 2-D object
  7704. >8    string        TDDD        \b, TDDD 3-D rendering
  7705. >8    string        LWOB        \b, LWOB 3-D object
  7706. >8    string        LWO2        \b, LWO2 3-D object, v2
  7707. >8    string        LWLO        \b, LWLO 3-D layered object
  7708. >8    string        REAL        \b, REAL Real3D rendering
  7709. >8    string        MC4D        \b, MC4D MaxonCinema4D rendering
  7710. >8    string        ANIM        \b, ANIM animation
  7711. >8    string        YAFA        \b, YAFA animation
  7712. >8    string        SSA\         \b, SSA super smooth animation
  7713. >8    string        ACBM        \b, ACBM continuous image
  7714. >8    string        FAXX        \b, FAXX fax image
  7715. # other formats
  7716. >8    string        FTXT        \b, FTXT formatted text
  7717. >8    string        CTLG        \b, CTLG message catalog
  7718. >8    string        PREF        \b, PREF preferences
  7719. >8    string        DTYP        \b, DTYP datatype description
  7720. >8    string        PTCH        \b, PTCH binary patch
  7721. >8    string        AMFF        \b, AMFF AmigaMetaFile format
  7722. >8    string        WZRD        \b, WZRD StormWIZARD resource
  7723. >8    string        DOC\         \b, DOC desktop publishing document
  7724.  
  7725. # These go at the end of the iff rules
  7726. #
  7727. # I don't see why these might collide with anything else.
  7728. #
  7729. # Interactive Fiction related formats
  7730. #
  7731. >8    string        IFRS        \b, Blorb Interactive Fiction
  7732. >>24    string        Exec        with executable chunk
  7733. >8    string          IFZS        \b, Z-machine or Glulx saved game file (Quetzal)
  7734. #------------------------------------------------------------------------------
  7735. # images:  file(1) magic for image formats (see also "iff", and "c-lang" for
  7736. # XPM bitmaps)
  7737. #
  7738. # originally from jef@helios.ee.lbl.gov (Jef Poskanzer),
  7739. # additions by janl@ifi.uio.no as well as others. Jan also suggested
  7740. # merging several one- and two-line files into here.
  7741. #
  7742. # little magic: PCX (first byte is 0x0a)
  7743.  
  7744. # Targa - matches `povray', `ppmtotga' and `xv' outputs
  7745. # by Philippe De Muyter <phdm@macqel.be>
  7746. # at 2, byte ImgType must be 1, 2, 3, 9, 10 or 11
  7747. # at 1, byte CoMapType must be 1 if ImgType is 1 or 9, 0 otherwise
  7748. # at 3, leshort Index is 0 for povray, ppmtotga and xv outputs
  7749. # `xv' recognizes only a subset of the following (RGB with pixelsize = 24)
  7750. # `tgatoppm' recognizes a superset (Index may be anything)
  7751. 1    belong&0xfff7ffff    0x01010000    Targa image data - Map
  7752. >2    byte&8            8        - RLE
  7753. >12    leshort            >0        %hd x
  7754. >14    leshort            >0        %hd
  7755. 1    belong&0xfff7ffff    0x00020000    Targa image data - RGB
  7756. >2    byte&8            8        - RLE
  7757. >12    leshort            >0        %hd x
  7758. >14    leshort            >0        %hd
  7759. 1    belong&0xfff7ffff    0x00030000    Targa image data - Mono
  7760. >2    byte&8            8        - RLE
  7761. >12    leshort            >0        %hd x
  7762. >14    leshort            >0        %hd
  7763.  
  7764. # PBMPLUS images
  7765. # The next byte following the magic is always whitespace.
  7766. 0    search/1    P1        Netpbm PBM image text
  7767. !:mime    image/x-portable-bitmap
  7768. 0    search/1    P2        Netpbm PGM image text
  7769. !:mime    image/x-portable-greymap
  7770. 0    search/1    P3        Netpbm PPM image text
  7771. !:mime    image/x-portable-pixmap
  7772. 0    string        P4        Netpbm PBM "rawbits" image data
  7773. !:mime    image/x-portable-bitmap
  7774. 0    string        P5        Netpbm PGM "rawbits" image data
  7775. !:mime    image/x-portable-greymap
  7776. 0    string        P6        Netpbm PPM "rawbits" image data
  7777. !:mime    image/x-portable-pixmap
  7778. 0    string        P7        Netpbm PAM image file
  7779. !:mime    image/x-portable-pixmap
  7780.  
  7781. # From: bryanh@giraffe-data.com (Bryan Henderson)
  7782. 0    string        \117\072    Solitaire Image Recorder format
  7783. >4    string        \013        MGI Type 11
  7784. >4    string        \021        MGI Type 17
  7785. 0    string        .MDA        MicroDesign data
  7786. >21    byte        48        version 2
  7787. >21    byte        51        version 3
  7788. 0    string        .MDP        MicroDesign page data
  7789. >21    byte        48        version 2
  7790. >21    byte        51        version 3
  7791.  
  7792. # NIFF (Navy Interchange File Format, a modification of TIFF) images
  7793. # [GRR:  this *must* go before TIFF]
  7794. 0    string        IIN1        NIFF image data
  7795. !:mime    image/x-niff
  7796.  
  7797. # Tag Image File Format, from Daniel Quinlan (quinlan@yggdrasil.com)
  7798. # The second word of TIFF files is the TIFF version number, 42, which has
  7799. # never changed.  The TIFF specification recommends testing for it.
  7800. 0    string        MM\x00\x2a    TIFF image data, big-endian
  7801. !:mime    image/tiff
  7802. 0    string        II\x2a\x00    TIFF image data, little-endian
  7803. !:mime    image/tiff
  7804.  
  7805. # PNG [Portable Network Graphics, or "PNG's Not GIF"] images
  7806. # (Greg Roelofs, newt@uchicago.edu)
  7807. # (Albert Cahalan, acahalan@cs.uml.edu)
  7808. #
  7809. # 137 P N G \r \n ^Z \n [4-byte length] H E A D [HEAD data] [HEAD crc] ...
  7810. #
  7811. 0    string        \x89PNG\x0d\x0a\x1a\x0a        PNG image
  7812. !:mime    image/png
  7813. >16    belong        x        \b, %ld x
  7814. >20    belong        x        %ld,
  7815. >24    byte        x        %d-bit
  7816. >25    byte        0        grayscale,
  7817. >25    byte        2        \b/color RGB,
  7818. >25    byte        3        colormap,
  7819. >25    byte        4        gray+alpha,
  7820. >25    byte        6        \b/color RGBA,
  7821. #>26    byte        0        deflate/32K,
  7822. >28    byte        0        non-interlaced
  7823. >28    byte        1        interlaced
  7824.  
  7825. # possible GIF replacements; none yet released!
  7826. # (Greg Roelofs, newt@uchicago.edu)
  7827. #
  7828. # GRR 950115:  this was mine ("Zip GIF"):
  7829. 0    string        GIF94z        ZIF image (GIF+deflate alpha)
  7830. !:mime    image/x-unknown
  7831. #
  7832. # GRR 950115:  this is Jeremy Wohl's Free Graphics Format (better):
  7833. #                    
  7834. 0    string        FGF95a        FGF image (GIF+deflate beta)
  7835. !:mime    image/x-unknown
  7836. #
  7837. # GRR 950115:  this is Thomas Boutell's Portable Bitmap Format proposal
  7838. # (best; not yet implemented):
  7839. #                    
  7840. 0    string        PBF        PBF image (deflate compression)
  7841. !:mime    image/x-unknown
  7842.  
  7843. # GIF
  7844. 0    string        GIF8        GIF image data
  7845. !:mime    image/gif
  7846. >4    string        7a        \b, version 8%s,
  7847. >4    string        9a        \b, version 8%s,
  7848. >6    leshort        >0        %hd x
  7849. >8    leshort        >0        %hd
  7850. #>10    byte        &0x80        color mapped,
  7851. #>10    byte&0x07    =0x00        2 colors
  7852. #>10    byte&0x07    =0x01        4 colors
  7853. #>10    byte&0x07    =0x02        8 colors
  7854. #>10    byte&0x07    =0x03        16 colors
  7855. #>10    byte&0x07    =0x04        32 colors
  7856. #>10    byte&0x07    =0x05        64 colors
  7857. #>10    byte&0x07    =0x06        128 colors
  7858. #>10    byte&0x07    =0x07        256 colors
  7859.  
  7860. # ITC (CMU WM) raster files.  It is essentially a byte-reversed Sun raster,
  7861. # 1 plane, no encoding.
  7862. 0    string        \361\0\100\273    CMU window manager raster image data
  7863. >4    lelong        >0        %d x
  7864. >8    lelong        >0        %d,
  7865. >12    lelong        >0        %d-bit
  7866.  
  7867. # Magick Image File Format
  7868. 0    string        id=ImageMagick    MIFF image data
  7869.  
  7870. # Artisan
  7871. 0    long        1123028772    Artisan image data
  7872. >4    long        1        \b, rectangular 24-bit
  7873. >4    long        2        \b, rectangular 8-bit with colormap
  7874. >4    long        3        \b, rectangular 32-bit (24-bit with matte)
  7875.  
  7876. # FIG (Facility for Interactive Generation of figures), an object-based format
  7877. 0    search/1    #FIG        FIG image text
  7878. >5    string        x        \b, version %.3s
  7879.  
  7880. # PHIGS
  7881. 0    string        ARF_BEGARF        PHIGS clear text archive
  7882. 0    string        @(#)SunPHIGS        SunPHIGS
  7883. # version number follows, in the form m.n
  7884. >40    string        SunBin            binary
  7885. >32    string        archive            archive
  7886.  
  7887. # GKS (Graphics Kernel System)
  7888. 0    string        GKSM        GKS Metafile
  7889. >24    string        SunGKS        \b, SunGKS
  7890.  
  7891. # CGM image files
  7892. 0    string        BEGMF        clear text Computer Graphics Metafile
  7893.  
  7894. # MGR bitmaps  (Michael Haardt, u31b3hs@pool.informatik.rwth-aachen.de)
  7895. 0    string    yz    MGR bitmap, modern format, 8-bit aligned
  7896. 0    string    zz    MGR bitmap, old format, 1-bit deep, 16-bit aligned
  7897. 0    string    xz    MGR bitmap, old format, 1-bit deep, 32-bit aligned
  7898. 0    string    yx    MGR bitmap, modern format, squeezed
  7899.  
  7900. # Fuzzy Bitmap (FBM) images
  7901. 0    string        %bitmap\0    FBM image data
  7902. >30    long        0x31        \b, mono
  7903. >30    long        0x33        \b, color
  7904.  
  7905. # facsimile data
  7906. 1    string        PC\ Research,\ Inc    group 3 fax data
  7907. >29    byte        0        \b, normal resolution (204x98 DPI)
  7908. >29    byte        1        \b, fine resolution (204x196 DPI)
  7909. # From: Herbert Rosmanith <herp@wildsau.idv.uni.linz.at>
  7910. 0    string        Sfff        structured fax file
  7911.  
  7912.  
  7913. # PC bitmaps (OS/2, Windows BMP files)  (Greg Roelofs, newt@uchicago.edu)
  7914. 0    string        BM
  7915. >14    leshort        12        PC bitmap, OS/2 1.x format
  7916. !:mime    image/x-ms-bmp
  7917. >>18    leshort        x        \b, %d x
  7918. >>20    leshort        x        %d
  7919. >14    leshort        64        PC bitmap, OS/2 2.x format
  7920. !:mime    image/x-ms-bmp
  7921. >>18    leshort        x        \b, %d x
  7922. >>20    leshort        x        %d
  7923. >14    leshort        40        PC bitmap, Windows 3.x format
  7924. !:mime    image/x-ms-bmp
  7925. >>18    lelong        x        \b, %d x
  7926. >>22    lelong        x        %d x
  7927. >>28    leshort        x        %d
  7928. >14    leshort        128        PC bitmap, Windows NT/2000 format
  7929. !:mime    image/x-ms-bmp
  7930. >>18    lelong        x        \b, %d x
  7931. >>22    lelong        x        %d x
  7932. >>28    leshort        x        %d
  7933. # Too simple - MPi
  7934. #0    string        IC        PC icon data
  7935. #0    string        PI        PC pointer image data
  7936. #0    string        CI        PC color icon data
  7937. #0    string        CP        PC color pointer image data
  7938. # Conflicts with other entries [BABYL]
  7939. #0    string        BA        PC bitmap array data
  7940.  
  7941. # XPM icons (Greg Roelofs, newt@uchicago.edu)
  7942. # note possible collision with C/REXX entry in c-lang; currently commented out
  7943. 0    search/1    /*\ XPM\ */    X pixmap image text
  7944.  
  7945. # Utah Raster Toolkit RLE images (janl@ifi.uio.no)
  7946. 0    leshort        0xcc52        RLE image data,
  7947. >6    leshort        x        %d x
  7948. >8    leshort        x        %d
  7949. >2    leshort        >0        \b, lower left corner: %d
  7950. >4    leshort        >0        \b, lower right corner: %d
  7951. >10    byte&0x1    =0x1        \b, clear first
  7952. >10    byte&0x2    =0x2        \b, no background
  7953. >10    byte&0x4    =0x4        \b, alpha channel
  7954. >10    byte&0x8    =0x8        \b, comment
  7955. >11    byte        >0        \b, %d color channels
  7956. >12    byte        >0        \b, %d bits per pixel
  7957. >13    byte        >0        \b, %d color map channels
  7958.  
  7959. # image file format (Robert Potter, potter@cs.rochester.edu)
  7960. 0    string        Imagefile\ version-    iff image data
  7961. # this adds the whole header (inc. version number), informative but longish
  7962. >10    string        >\0        %s
  7963.  
  7964. # Sun raster images, from Daniel Quinlan (quinlan@yggdrasil.com)
  7965. 0    belong        0x59a66a95    Sun raster image data
  7966. >4    belong        >0        \b, %d x
  7967. >8    belong        >0        %d,
  7968. >12    belong        >0        %d-bit,
  7969. #>16    belong        >0        %d bytes long,
  7970. >20    belong        0        old format,
  7971. #>20    belong        1        standard,
  7972. >20    belong        2        compressed,
  7973. >20    belong        3        RGB,
  7974. >20    belong        4        TIFF,
  7975. >20    belong        5        IFF,
  7976. >20    belong        0xffff        reserved for testing,
  7977. >24    belong        0        no colormap
  7978. >24    belong        1        RGB colormap
  7979. >24    belong        2        raw colormap
  7980. #>28    belong        >0        colormap is %d bytes long
  7981.  
  7982. # SGI image file format, from Daniel Quinlan (quinlan@yggdrasil.com)
  7983. #
  7984. # See
  7985. #    http://reality.sgi.com/grafica/sgiimage.html
  7986. #
  7987. 0    beshort        474        SGI image data
  7988. #>2    byte        0        \b, verbatim
  7989. >2    byte        1        \b, RLE
  7990. #>3    byte        1        \b, normal precision
  7991. >3    byte        2        \b, high precision
  7992. >4    beshort        x        \b, %d-D
  7993. >6    beshort        x        \b, %d x
  7994. >8    beshort        x        %d
  7995. >10    beshort        x        \b, %d channel
  7996. >10    beshort        !1        \bs
  7997. >80    string        >0        \b, "%s"
  7998.  
  7999. 0    string        IT01        FIT image data
  8000. >4    belong        x        \b, %d x
  8001. >8    belong        x        %d x
  8002. >12    belong        x        %d
  8003. #
  8004. 0    string        IT02        FIT image data
  8005. >4    belong        x        \b, %d x
  8006. >8    belong        x        %d x
  8007. >12    belong        x        %d
  8008. #
  8009. 2048    string        PCD_IPI        Kodak Photo CD image pack file
  8010. >0xe02    byte&0x03    0x00        , landscape mode
  8011. >0xe02    byte&0x03    0x01        , portrait mode
  8012. >0xe02    byte&0x03    0x02        , landscape mode
  8013. >0xe02    byte&0x03    0x03        , portrait mode
  8014. 0    string        PCD_OPA        Kodak Photo CD overview pack file
  8015.  
  8016. # FITS format.  Jeff Uphoff <juphoff@tarsier.cv.nrao.edu>
  8017. # FITS is the Flexible Image Transport System, the de facto standard for
  8018. # data and image transfer, storage, etc., for the astronomical community.
  8019. # (FITS floating point formats are big-endian.)
  8020. 0    string    SIMPLE\ \ =    FITS image data
  8021. >109    string    8        \b, 8-bit, character or unsigned binary integer
  8022. >108    string    16        \b, 16-bit, two's complement binary integer
  8023. >107    string    \ 32        \b, 32-bit, two's complement binary integer
  8024. >107    string    -32        \b, 32-bit, floating point, single precision
  8025. >107    string    -64        \b, 64-bit, floating point, double precision
  8026.  
  8027. # other images
  8028. 0    string    This\ is\ a\ BitMap\ file    Lisp Machine bit-array-file
  8029.  
  8030. # From SunOS 5.5.1 "/etc/magic" - appeared right before Sun raster image
  8031. # stuff.
  8032. #
  8033. 0    beshort        0x1010        PEX Binary Archive
  8034.  
  8035. # DICOM medical imaging data
  8036. 128    string    DICM            DICOM medical imaging data
  8037. !:mime    application/dicom
  8038.  
  8039. # XWD - X Window Dump file.
  8040. #   As described in /usr/X11R6/include/X11/XWDFile.h
  8041. #   used by the xwd program.
  8042. #   Bradford Castalia, idaeim, 1/01
  8043. 4    belong    7            XWD X Window Dump image data
  8044. >100    string    >\0            \b, "%s"
  8045. >16    belong    x            \b, %dx
  8046. >20    belong    x            \b%dx
  8047. >12    belong    x            \b%d
  8048.  
  8049. # PDS - Planetary Data System
  8050. #   These files use Parameter Value Language in the header section.
  8051. #   Unfortunately, there is no certain magic, but the following
  8052. #   strings have been found to be most likely.
  8053. 0    string    NJPL1I00        PDS (JPL) image data
  8054. 2    string    NJPL1I            PDS (JPL) image data
  8055. 0    string    CCSD3ZF            PDS (CCSD) image data
  8056. 2    string    CCSD3Z            PDS (CCSD) image data
  8057. 0    string    PDS_            PDS image data
  8058. 0    string    LBLSIZE=        PDS (VICAR) image data
  8059.  
  8060. # pM8x: ATARI STAD compressed bitmap format
  8061. #
  8062. # from Oskar Schirmer <schirmer@scara.com> Feb 2, 2001
  8063. # p M 8 5/6 xx yy zz data...
  8064. # Atari ST STAD bitmap is always 640x400, bytewise runlength compressed.
  8065. # bytes either run horizontally (pM85) or vertically (pM86). yy is the
  8066. # most frequent byte, xx and zz are runlength escape codes, where xx is
  8067. # used for runs of yy.
  8068. #
  8069. 0    string    pM85        Atari ST STAD bitmap image data (hor)
  8070. >5    byte    0x00        (white background)
  8071. >5    byte    0xFF        (black background)
  8072. 0    string    pM86        Atari ST STAD bitmap image data (vert)
  8073. >5    byte    0x00        (white background)
  8074. >5    byte    0xFF        (black background)
  8075.  
  8076. # Gürkan Sengün <gurkan@linuks.mine.nu>, www.linuks.mine.nu
  8077. # http://www.atarimax.com/jindroush.atari.org/afmtatr.html
  8078. 0    leshort    0x0296        Atari ATR image
  8079.  
  8080. # XXX:
  8081. # This is bad magic 0x5249 == 'RI' conflicts with RIFF and other
  8082. # magic.
  8083. # SGI RICE image file <mpruett@sgi.com>
  8084. #0    beshort    0x5249        RICE image
  8085. #>2    beshort    x        v%d
  8086. #>4    beshort    x        (%d x
  8087. #>6    beshort    x        %d)
  8088. #>8    beshort    0        8 bit
  8089. #>8    beshort    1        10 bit
  8090. #>8    beshort    2        12 bit
  8091. #>8    beshort    3        13 bit
  8092. #>10    beshort    0        4:2:2
  8093. #>10    beshort    1        4:2:2:4
  8094. #>10    beshort    2        4:4:4
  8095. #>10    beshort    3        4:4:4:4
  8096. #>12    beshort    1        RGB
  8097. #>12    beshort    2        CCIR601
  8098. #>12    beshort    3        RP175
  8099. #>12    beshort    4        YUV
  8100.  
  8101. #------------------------------------------------------------------------------
  8102. #
  8103. # Marco Schmidt (marcoschmidt@users.sourceforge.net) -- an image  file format
  8104. # for the EPOC operating system, which is used with PDAs like those from Psion
  8105. #
  8106. # see http://huizen.dds.nl/~frodol/psiconv/html/Index.html for a description
  8107. # of various EPOC file formats
  8108.  
  8109. 0    string \x37\x00\x00\x10\x42\x00\x00\x10\x00\x00\x00\x00\x39\x64\x39\x47 EPOC MBM image file
  8110.  
  8111. # PCX image files
  8112. # From: Dan Fandrich <dan@coneharvesters.com>
  8113. 0    beshort        0x0a00    PCX ver. 2.5 image data
  8114. 0    beshort        0x0a02    PCX ver. 2.8 image data, with palette
  8115. 0    beshort        0x0a03    PCX ver. 2.8 image data, without palette
  8116. 0    beshort        0x0a04    PCX for Windows image data
  8117. 0    beshort        0x0a05    PCX ver. 3.0 image data
  8118. >4    leshort        x      bounding box [%hd,
  8119. >6    leshort        x      %hd] -
  8120. >8    leshort        x      [%hd,
  8121. >10    leshort        x      %hd],
  8122. >65    byte        >1    %d planes each of
  8123. >3    byte        x    %hhd-bit
  8124. >68    byte        0    image,
  8125. >68    byte        1    colour,
  8126. >68    byte        2    grayscale,
  8127. >68    byte        >2    image,
  8128. >68    byte        <0    image,
  8129. >12    leshort        >0    %hd x
  8130. >>14    leshort        x      %hd dpi,
  8131. >2    byte        0    uncompressed
  8132. >2    byte        1    RLE compressed
  8133.  
  8134. # Adobe Photoshop
  8135. 0    string        8BPS Adobe Photoshop Image
  8136. !:mime    image/vnd.adobe.photoshop
  8137.  
  8138. # XV thumbnail indicator (ThMO)
  8139. 0    string        P7\ 332        XV thumbnail image data
  8140.  
  8141. # NITF is defined by United States MIL-STD-2500A
  8142. 0    string    NITF    National Imagery Transmission Format
  8143. >25    string    >\0    dated %.14s
  8144.  
  8145. # GEM Image: Version 1, Headerlen 8 (Wolfram Kleff)
  8146. 0    belong        0x00010008    GEM Image data
  8147. >12    beshort        x        %d x
  8148. >14    beshort        x        %d,
  8149. >4    beshort        x        %d planes,
  8150. >8    beshort        x        %d x
  8151. >10    beshort        x        %d pixelsize
  8152.  
  8153. # GEM Metafile (Wolfram Kleff)
  8154. 0    lelong        0x0018FFFF    GEM Metafile data
  8155. >4    leshort        x        version %d
  8156.  
  8157. #
  8158. # SMJPEG. A custom Motion JPEG format used by Loki Entertainment
  8159. # Software Torbjorn Andersson <d91tan@Update.UU.SE>.
  8160. #
  8161. 0    string    \0\nSMJPEG    SMJPEG
  8162. >8    belong    x        %d.x data
  8163. # According to the specification you could find any number of _TXT
  8164. # headers here, but I can't think of any way of handling that. None of
  8165. # the SMJPEG files I tried it on used this feature. Even if such a
  8166. # file is encountered the output should still be reasonable.
  8167. >16    string    _SND        \b,
  8168. >>24    beshort    >0        %d Hz
  8169. >>26    byte    8        8-bit
  8170. >>26    byte    16        16-bit
  8171. >>28    string    NONE        uncompressed
  8172. # >>28    string    APCM        ADPCM compressed
  8173. >>27    byte    1        mono
  8174. >>28    byte    2        stereo
  8175. # Help! Isn't there any way to avoid writing this part twice?
  8176. >>32    string    _VID        \b,
  8177. # >>>48    string    JFIF        JPEG
  8178. >>>40    belong    >0        %d frames
  8179. >>>44    beshort    >0        (%d x
  8180. >>>46    beshort    >0        %d)
  8181. >16    string    _VID        \b,
  8182. # >>32    string    JFIF        JPEG
  8183. >>24    belong    >0        %d frames
  8184. >>28    beshort    >0        (%d x
  8185. >>30    beshort    >0        %d)
  8186.  
  8187. 0    string    Paint\ Shop\ Pro\ Image\ File    Paint Shop Pro Image File
  8188.  
  8189. # "thumbnail file" (icon)
  8190. # descended from "xv", but in use by other applications as well (Wolfram Kleff)
  8191. 0       string          P7\ 332         XV "thumbnail file" (icon) data
  8192.  
  8193. # taken from fkiss: (<yav@mte.biglobe.ne.jp> ?)
  8194. 0       string          KiSS            KISS/GS
  8195. >4      byte            16              color
  8196. >>5     byte            x               %d bit
  8197. >>8     leshort         x               %d colors
  8198. >>10    leshort         x               %d groups
  8199. >4      byte            32              cell
  8200. >>5     byte            x               %d bit
  8201. >>8     leshort         x               %d x
  8202. >>10    leshort         x               %d
  8203. >>12    leshort         x               +%d
  8204. >>14    leshort         x               +%d
  8205.  
  8206. # Webshots (www.webshots.com), by John Harrison
  8207. 0       string          C\253\221g\230\0\0\0 Webshots Desktop .wbz file
  8208.  
  8209. # Hercules DASD image files
  8210. # From Jan Jaeger <jj@septa.nl>
  8211. 0       string  CKD_P370        Hercules CKD DASD image file
  8212. >8      long    x               \b, %d heads per cylinder
  8213. >12     long    x               \b, track size %d bytes
  8214. >16     byte    x               \b, device type 33%2.2X
  8215.  
  8216. 0       string  CKD_C370        Hercules compressed CKD DASD image file
  8217. >8      long    x               \b, %d heads per cylinder
  8218. >12     long    x               \b, track size %d bytes
  8219. >16     byte    x               \b, device type 33%2.2X
  8220.  
  8221. 0       string  CKD_S370        Hercules CKD DASD shadow file
  8222. >8      long    x               \b, %d heads per cylinder
  8223. >12     long    x               \b, track size %d bytes
  8224. >16     byte    x               \b, device type 33%2.2X
  8225.  
  8226. # Squeak images and programs - etoffi@softhome.net
  8227. 0    string        \146\031\0\0    Squeak image data
  8228. 0    search/1    'From\040Squeak    Squeak program text
  8229.  
  8230. # partimage: file(1) magic for PartImage files (experimental, incomplete)
  8231. # Author: Hans-Joachim Baader <hjb@pro-linux.de>
  8232. 0        string    PaRtImAgE-VoLuMe    PartImage
  8233. >0x0020        string    0.6.1        file version %s
  8234. >>0x0060    lelong    >-1        volume %ld
  8235. #>>0x0064 8 byte identifier
  8236. #>>0x007c reserved
  8237. >>0x0200    string    >\0        type %s
  8238. >>0x1400    string    >\0        device %s,
  8239. >>0x1600    string    >\0        original filename %s,
  8240. # Some fields omitted
  8241. >>0x2744    lelong    0        not compressed
  8242. >>0x2744    lelong    1        gzip compressed
  8243. >>0x2744    lelong    2        bzip2 compressed
  8244. >>0x2744    lelong    >2        compressed with unknown algorithm
  8245. >0x0020        string    >0.6.1        file version %s
  8246. >0x0020        string    <0.6.1        file version %s
  8247.  
  8248. # DCX is multi-page PCX, using a simple header of up to 1024
  8249. # offsets for the respective PCX components.
  8250. # From: Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de>
  8251. 0    lelong    987654321    DCX multi-page PCX image data
  8252.  
  8253. # Simon Walton <simonw@matteworld.com>
  8254. # Kodak Cineon format for scanned negatives
  8255. # http://www.kodak.com/US/en/motion/support/dlad/
  8256. 0    lelong  0xd75f2a80    Cineon image data
  8257. >200    belong  >0        \b, %ld x
  8258. >204    belong  >0        %ld
  8259.  
  8260.  
  8261. # Bio-Rad .PIC is an image format used by microscope control systems
  8262. # and related image processing software used by biologists.
  8263. # From: Vebjorn Ljosa <vebjorn@ljosa.com>
  8264. 54    leshort 12345        Bio-Rad .PIC Image File
  8265. >0    leshort >0        %hd x
  8266. >2    leshort >0        %hd,
  8267. >4    leshort =1        1 image in file
  8268. >4    leshort >1        %hd images in file
  8269.  
  8270. # From Jan "Yenya" Kasprzak <kas@fi.muni.cz>
  8271. # The description of *.mrw format can be found at
  8272. # http://www.dalibor.cz/minolta/raw_file_format.htm
  8273. 0    string    \000MRM            Minolta Dimage camera raw image data
  8274.  
  8275. # Summary: DjVu image / document
  8276. # Extension: .djvu
  8277. # Reference: http://djvu.org/docs/DjVu3Spec.djvu
  8278. # Submitted by: Stephane Loeuillet <stephane.loeuillet@tiscali.fr>
  8279. # Modified by (1): Abel Cheung <abelcheung@gmail.com>
  8280. 0    string    AT&TFORM
  8281. !:mime    image/vnd.djvu
  8282. >12    string    DJVM        DjVu multiple page document
  8283. >12    string    DJVU        DjVu image or single page document
  8284. >12    string    DJVI        DjVu shared document
  8285. >12    string    THUM        DjVu page thumbnails
  8286.  
  8287.  
  8288. # From Marc Espie
  8289. 0    lelong    20000630        OpenEXR image data
  8290.  
  8291. # From: Tom Hilinski <tom.hilinski@comcast.net>
  8292. # http://www.unidata.ucar.edu/packages/netcdf/
  8293. 0    string    CDF\001            NetCDF Data Format data
  8294.  
  8295. #-----------------------------------------------------------------------
  8296. # Hierarchical Data Format, used to facilitate scientific data exchange
  8297. # specifications at http://hdf.ncsa.uiuc.edu/
  8298. 0    belong    0x0e031301    Hierarchical Data Format (version 4) data
  8299. !:mime    application/x-hdf
  8300. 0    string    \211HDF\r\n\032    Hierarchical Data Format (version 5) data
  8301. !:mime    application/x-hdf
  8302.  
  8303. # From: Tobias Burnus <burnus@net-b.de>
  8304. # Xara (for a while: Corel Xara) is a graphic package, see
  8305. # http://www.xara.com/ for Windows and as GPL application for Linux
  8306. 0    string    XARA\243\243    Xara graphics file
  8307.  
  8308. # http://www.cartesianinc.com/Tech/
  8309. 0    string    CPC\262        Cartesian Perceptual Compression image
  8310. !:mime    image/x-cpi
  8311.  
  8312. # From Albert Cahalan <acahalan@gmail.com>
  8313. # puredigital used it for the CVS disposable camcorder
  8314. #8       lelong  4       ZBM bitmap image data
  8315. #>4      leshort x       %u x
  8316. #>6      leshort x       %u
  8317.  
  8318. # From Albert Cahalan <acahalan@gmail.com>
  8319. # uncompressed 5:6:5 HighColor image for OLPC XO firmware icons
  8320. 0       string C565     OLPC firmware icon image data
  8321. >4      leshort x       %u x
  8322. >6      leshort x       %u
  8323.  
  8324. # Applied Images - Image files from Cytovision
  8325. # Gustavo Junior Alves <gjalves@gjalves.com.br>
  8326. 0    string    \xce\xda\xde\xfa    Cytovision Metaphases file
  8327. 0    string    \xed\xad\xef\xac    Cytovision Karyotype file
  8328. 0    string    \x0b\x00\x03\x00    Cytovision FISH Probe file
  8329. 0    string    \xed\xfe\xda\xbe    Cytovision FLEX file
  8330. 0    string    \xed\xab\xed\xfe    Cytovision FLEX file
  8331. 0    string    \xad\xfd\xea\xad    Cytovision RATS file
  8332.  
  8333. # Wavelet Scalar Quantization format used in gray-scale fingerprint images
  8334. # From Tano M Fotang <mfotang@quanteq.com>
  8335. 0    string    \xff\xa0\xff\xa8\x00    Wavelet Scalar Quantization image data
  8336.  
  8337. # Type:    Ulead Photo Explorer5 (.pe5)
  8338. # URL:    http://www.jisyo.com/cgibin/view.cgi?EXT=pe5 (Japanese)
  8339. # From:    Simon Horman <horms@debian.org>
  8340. 0    string    IIO2H    Ulead Photo Explorer5
  8341.  
  8342. # Type:    X11 cursor
  8343. # URL:    http://webcvs.freedesktop.org/mime/shared-mime-info/freedesktop.org.xml.in?view=markup
  8344. # From:    Mathias Brodala <info@noctus.net>
  8345. 0    string    Xcur    X11 cursor
  8346.  
  8347. #------------------------------------------------------------------------------
  8348. # inform:  file(1) magic for Inform interactive fiction language
  8349.  
  8350. # URL:  http://www.inform-fiction.org/
  8351. # From: Reuben Thomas <rrt@sc3d.org>
  8352.  
  8353. 0    search/cB/100    constant\ story        Inform source text
  8354.  
  8355. #------------------------------------------------------------------------------
  8356. # intel:  file(1) magic for x86 Unix
  8357. #
  8358. # Various flavors of x86 UNIX executable/object (other than Xenix, which
  8359. # is in "microsoft").  DOS is in "msdos"; the ambitious soul can do
  8360. # Windows as well.
  8361. #
  8362. # Windows NT belongs elsewhere, as you need x86 and MIPS and Alpha and
  8363. # whatever comes next (HP-PA Hummingbird?).  OS/2 may also go elsewhere
  8364. # as well, if, as, and when IBM makes it portable.
  8365. #
  8366. # The `versions' should be un-commented if they work for you.
  8367. # (Was the problem just one of endianness?)
  8368. #
  8369. 0    leshort        0502        basic-16 executable
  8370. >12    lelong        >0        not stripped
  8371. #>22    leshort        >0        - version %ld
  8372. 0    leshort        0503        basic-16 executable (TV)
  8373. >12    lelong        >0        not stripped
  8374. #>22    leshort        >0        - version %ld
  8375. 0    leshort        0510        x86 executable
  8376. >12    lelong        >0        not stripped
  8377. 0    leshort        0511        x86 executable (TV)
  8378. >12    lelong        >0        not stripped
  8379. 0    leshort        =0512        iAPX 286 executable small model (COFF)
  8380. >12    lelong        >0        not stripped
  8381. #>22    leshort        >0        - version %ld
  8382. 0    leshort        =0522        iAPX 286 executable large model (COFF)
  8383. >12    lelong        >0        not stripped
  8384. #>22    leshort        >0        - version %ld
  8385. # SGI labeled the next entry as "iAPX 386 executable" --Dan Quinlan
  8386. 0    leshort        =0514        80386 COFF executable
  8387. >12    lelong        >0        not stripped
  8388. >22    leshort        >0        - version %ld
  8389.  
  8390. # rom: file(1) magic for BIOS ROM Extensions found in intel machines
  8391. #      mapped into memory between 0xC0000 and 0xFFFFF
  8392. # From Gürkan Sengün <gurkan@linuks.mine.nu>, www.linuks.mine.nu
  8393. 0        beshort         0x55AA       BIOS (ia32) ROM Ext.
  8394. >5       string          USB          USB
  8395. >7       string          LDR          UNDI image
  8396. >30      string          IBM          IBM comp. Video
  8397. >26      string          Adaptec      Adaptec
  8398. >28      string          Adaptec      Adaptec
  8399. >42      string          PROMISE      Promise
  8400. >2       byte            x            (%d*512)
  8401.  
  8402. #------------------------------------------------------------------------------
  8403. # interleaf:  file(1) magic for InterLeaf TPS:
  8404. #
  8405. 0    string        =\210OPS    Interleaf saved data
  8406. 0    string        =<!OPS        Interleaf document text
  8407. >5    string        ,\ Version\ =    \b, version
  8408. >>17    string        >\0        %.3s
  8409.  
  8410. #------------------------------------------------------------------------------
  8411. # island:  file(1) magic for IslandWite/IslandDraw, from SunOS 5.5.1
  8412. # "/etc/magic":
  8413. # From: guy@netapp.com (Guy Harris)
  8414. #
  8415. 4    string        pgscriptver    IslandWrite document
  8416. 13    string        DrawFile    IslandDraw document
  8417.  
  8418.  
  8419. #------------------------------------------------------------------------------
  8420. # ispell:  file(1) magic for ispell
  8421. #
  8422. # Ispell 3.0 has a magic of 0x9601 and ispell 3.1 has 0x9602.  This magic
  8423. # will match 0x9600 through 0x9603 in *both* little endian and big endian.
  8424. # (No other current magic entries collide.)
  8425. #
  8426. # Updated by Daniel Quinlan (quinlan@yggdrasil.com)
  8427. #
  8428. 0    leshort&0xFFFC    0x9600        little endian ispell
  8429. >0    byte        0        hash file (?),
  8430. >0    byte        1        3.0 hash file,
  8431. >0    byte        2        3.1 hash file,
  8432. >0    byte        3        hash file (?),
  8433. >2    leshort        0x00        8-bit, no capitalization, 26 flags
  8434. >2    leshort        0x01        7-bit, no capitalization, 26 flags
  8435. >2    leshort        0x02        8-bit, capitalization, 26 flags
  8436. >2    leshort        0x03        7-bit, capitalization, 26 flags
  8437. >2    leshort        0x04        8-bit, no capitalization, 52 flags
  8438. >2    leshort        0x05        7-bit, no capitalization, 52 flags
  8439. >2    leshort        0x06        8-bit, capitalization, 52 flags
  8440. >2    leshort        0x07        7-bit, capitalization, 52 flags
  8441. >2    leshort        0x08        8-bit, no capitalization, 128 flags
  8442. >2    leshort        0x09        7-bit, no capitalization, 128 flags
  8443. >2    leshort        0x0A        8-bit, capitalization, 128 flags
  8444. >2    leshort        0x0B        7-bit, capitalization, 128 flags
  8445. >2    leshort        0x0C        8-bit, no capitalization, 256 flags
  8446. >2    leshort        0x0D        7-bit, no capitalization, 256 flags
  8447. >2    leshort        0x0E        8-bit, capitalization, 256 flags
  8448. >2    leshort        0x0F        7-bit, capitalization, 256 flags
  8449. >4    leshort        >0        and %d string characters
  8450. 0    beshort&0xFFFC    0x9600        big endian ispell
  8451. >1    byte        0        hash file (?),
  8452. >1    byte        1        3.0 hash file,
  8453. >1    byte        2        3.1 hash file,
  8454. >1    byte        3        hash file (?),
  8455. >2    beshort        0x00        8-bit, no capitalization, 26 flags
  8456. >2    beshort        0x01        7-bit, no capitalization, 26 flags
  8457. >2    beshort        0x02        8-bit, capitalization, 26 flags
  8458. >2    beshort        0x03        7-bit, capitalization, 26 flags
  8459. >2    beshort        0x04        8-bit, no capitalization, 52 flags
  8460. >2    beshort        0x05        7-bit, no capitalization, 52 flags
  8461. >2    beshort        0x06        8-bit, capitalization, 52 flags
  8462. >2    beshort        0x07        7-bit, capitalization, 52 flags
  8463. >2    beshort        0x08        8-bit, no capitalization, 128 flags
  8464. >2    beshort        0x09        7-bit, no capitalization, 128 flags
  8465. >2    beshort        0x0A        8-bit, capitalization, 128 flags
  8466. >2    beshort        0x0B        7-bit, capitalization, 128 flags
  8467. >2    beshort        0x0C        8-bit, no capitalization, 256 flags
  8468. >2    beshort        0x0D        7-bit, no capitalization, 256 flags
  8469. >2    beshort        0x0E        8-bit, capitalization, 256 flags
  8470. >2    beshort        0x0F        7-bit, capitalization, 256 flags
  8471. >4    beshort        >0        and %d string characters
  8472. # ispell 4.0 hash files  kromJx <kromJx@crosswinds.net>
  8473. # Ispell 4.0
  8474. 0       string          ISPL            ispell
  8475. >4      long            x               hash file version %d,
  8476. >8      long            x               lexletters %d,
  8477. >12     long            x               lexsize %d,
  8478. >16     long            x               hashsize %d,
  8479. >20     long            x               stblsize %d
  8480. #------------------------------------------------------------
  8481. # Java ByteCode and Mach-O binaries (e.g., Mac OS X) use the
  8482. # same magic number, 0xcafebabe, so they are both handled
  8483. # in the entry called "cafebabe".
  8484. #------------------------------------------------------------
  8485. # Java serialization
  8486. # From Martin Pool (m.pool@pharos.com.au)
  8487. 0    beshort        0xaced        Java serialization data
  8488. >2    beshort        >0x0004        \b, version %d
  8489.  
  8490. 0    belong        0xfeedfeed    Java KeyStore
  8491. !:mime    application/x-java-keystore
  8492. 0    belong        0xcececece    Java JCE KeyStore
  8493. !:mime    application/x-java-jce-keystore
  8494.  
  8495. # Dalvik .dex format. http://retrodev.com/android/dexformat.html
  8496. # From <mkf@google.com> "Mike Fleming"
  8497. 0    string    dex\n
  8498. >0    regex    dex\n[0-9][0-9][0-9]\0    Dalvik dex file
  8499. >4    string    >000            version %s
  8500. 0    string    dey\n
  8501. >0    regex    dey\n[0-9][0-9][0-9]\0    Dalvik dex file (optimized for host)
  8502. >4    string    >000            version %s
  8503.  
  8504.  
  8505. #------------------------------------------------------------------------------
  8506. # JPEG images
  8507. # SunOS 5.5.1 had
  8508. #
  8509. #    0    string        \377\330\377\340    JPEG file
  8510. #    0    string        \377\330\377\356    JPG file
  8511. #
  8512. # both of which turn into "JPEG image data" here.
  8513. #
  8514. 0    beshort        0xffd8        JPEG image data
  8515. !:mime    image/jpeg
  8516. !:strength +1
  8517. >6    string        JFIF        \b, JFIF standard
  8518. # The following added by Erik Rossen <rossen@freesurf.ch> 1999-09-06
  8519. # in a vain attempt to add image size reporting for JFIF.  Note that these
  8520. # tests are not fool-proof since some perfectly valid JPEGs are currently
  8521. # impossible to specify in magic(4) format.
  8522. # First, a little JFIF version info:
  8523. >>11    byte        x        \b %d.
  8524. >>12    byte        x        \b%02d
  8525. # Next, the resolution or aspect ratio of the image:
  8526. #>>13    byte        0        \b, aspect ratio
  8527. #>>13    byte        1        \b, resolution (DPI)
  8528. #>>13    byte        2        \b, resolution (DPCM)
  8529. #>>4    beshort        x        \b, segment length %d
  8530. # Next, show thumbnail info, if it exists:
  8531. >>18    byte        !0        \b, thumbnail %dx
  8532. >>>19    byte        x        \b%d
  8533.  
  8534. # EXIF moved down here to avoid reporting a bogus version number,
  8535. # and EXIF version number printing added.
  8536. #   - Patrik R=E5dman <patrik+file-magic@iki.fi>
  8537. >6    string        Exif        \b, EXIF standard
  8538. # Look for EXIF IFD offset in IFD 0, and then look for EXIF version tag in EXIF IFD.
  8539. # All possible combinations of entries have to be enumerated, since no looping
  8540. # is possible. And both endians are possible...
  8541. # The combinations included below are from real-world JPEGs.
  8542. # Little-endian
  8543. >>12    string        II        
  8544. # IFD 0 Entry #5:
  8545. >>>70    leshort        0x8769          
  8546. # EXIF IFD Entry #1:
  8547. >>>>(78.l+14)    leshort    0x9000        
  8548. >>>>>(78.l+23)    byte    x        %c
  8549. >>>>>(78.l+24)    byte    x        \b.%c
  8550. >>>>>(78.l+25)    byte    !0x30        \b%c
  8551. # IFD 0 Entry #9:
  8552. >>>118    leshort        0x8769          
  8553. # EXIF IFD Entry #3:
  8554. >>>>(126.l+38)    leshort    0x9000        
  8555. >>>>>(126.l+47)    byte    x        %c
  8556. >>>>>(126.l+48)    byte    x        \b.%c
  8557. >>>>>(126.l+49)    byte    !0x30        \b%c
  8558. # IFD 0 Entry #10
  8559. >>>130    leshort        0x8769          
  8560. # EXIF IFD Entry #3:
  8561. >>>>(138.l+38)    leshort    0x9000        
  8562. >>>>>(138.l+47)    byte    x        %c
  8563. >>>>>(138.l+48)    byte    x        \b.%c
  8564. >>>>>(138.l+49)    byte    !0x30        \b%c
  8565. # EXIF IFD Entry #4:
  8566. >>>>(138.l+50)    leshort    0x9000        
  8567. >>>>>(138.l+59)    byte    x        %c
  8568. >>>>>(138.l+60)    byte    x        \b.%c
  8569. >>>>>(138.l+61)    byte    !0x30        \b%c
  8570. # EXIF IFD Entry #5:
  8571. >>>>(138.l+62)    leshort    0x9000        
  8572. >>>>>(138.l+71)    byte    x        %c
  8573. >>>>>(138.l+72)    byte    x        \b.%c
  8574. >>>>>(138.l+73)    byte    !0x30        \b%c
  8575. # IFD 0 Entry #11
  8576. >>>142    leshort        0x8769          
  8577. # EXIF IFD Entry #3:
  8578. >>>>(150.l+38)    leshort    0x9000        
  8579. >>>>>(150.l+47)    byte    x        %c
  8580. >>>>>(150.l+48)    byte    x        \b.%c
  8581. >>>>>(150.l+49)    byte    !0x30        \b%c
  8582. # EXIF IFD Entry #4:
  8583. >>>>(150.l+50)    leshort    0x9000        
  8584. >>>>>(150.l+59)    byte    x        %c
  8585. >>>>>(150.l+60)    byte    x        \b.%c
  8586. >>>>>(150.l+61)    byte    !0x30        \b%c
  8587. # EXIF IFD Entry #5:
  8588. >>>>(150.l+62)    leshort    0x9000        
  8589. >>>>>(150.l+71)    byte    x        %c
  8590. >>>>>(150.l+72)    byte    x        \b.%c
  8591. >>>>>(150.l+73)    byte    !0x30        \b%c
  8592. # Big-endian
  8593. >>12    string        MM        
  8594. # IFD 0 Entry #9:
  8595. >>>118    beshort        0x8769          
  8596. # EXIF IFD Entry #1:
  8597. >>>>(126.L+14)    beshort    0x9000        
  8598. >>>>>(126.L+23)    byte    x        %c
  8599. >>>>>(126.L+24)    byte    x        \b.%c
  8600. >>>>>(126.L+25)    byte    !0x30        \b%c
  8601. # EXIF IFD Entry #3:
  8602. >>>>(126.L+38)    beshort    0x9000        
  8603. >>>>>(126.L+47)    byte    x        %c
  8604. >>>>>(126.L+48)    byte    x        \b.%c
  8605. >>>>>(126.L+49)    byte    !0x30        \b%c
  8606. # IFD 0 Entry #10
  8607. >>>130    beshort        0x8769          
  8608. # EXIF IFD Entry #3:
  8609. >>>>(138.L+38)    beshort    0x9000        
  8610. >>>>>(138.L+47)    byte    x        %c
  8611. >>>>>(138.L+48)    byte    x        \b.%c
  8612. >>>>>(138.L+49)    byte    !0x30        \b%c
  8613. # EXIF IFD Entry #5:
  8614. >>>>(138.L+62)    beshort    0x9000        
  8615. >>>>>(138.L+71)    byte    x        %c
  8616. >>>>>(138.L+72)    byte    x        \b.%c
  8617. >>>>>(138.L+73)    byte    !0x30        \b%c
  8618. # IFD 0 Entry #11
  8619. >>>142    beshort        0x8769          
  8620. # EXIF IFD Entry #4:
  8621. >>>>(150.L+50)    beshort    0x9000        
  8622. >>>>>(150.L+59)    byte    x        %c
  8623. >>>>>(150.L+60)    byte    x        \b.%c
  8624. >>>>>(150.L+61)    byte    !0x30        \b%c
  8625. # Here things get sticky.  We can do ONE MORE marker segment with
  8626. # indirect addressing, and that's all.  It would be great if we could
  8627. # do pointer arithemetic like in an assembler language.  Christos?
  8628. # And if there was some sort of looping construct to do searches, plus a few
  8629. # named accumulators, it would be even more effective...
  8630. # At least we can show a comment if no other segments got inserted before:
  8631. >(4.S+5)    byte        0xFE
  8632. >>(4.S+8)    string        >\0        \b, comment: "%s"
  8633. # FIXME: When we can do non-byte counted strings, we can use that to get
  8634. # the string's count, and fix Debian bug #283760
  8635. #>(4.S+5)    byte        0xFE        \b, comment
  8636. #>>(4.S+6)    beshort        x        \b length=%d
  8637. #>>(4.S+8)    string        >\0        \b, "%s"
  8638. # Or, we can show the encoding type (I've included only the three most common)
  8639. # and image dimensions if we are lucky and the SOFn (image segment) is here:
  8640. >(4.S+5)    byte        0xC0        \b, baseline
  8641. >>(4.S+6)    byte        x        \b, precision %d
  8642. >>(4.S+7)    beshort        x        \b, %dx
  8643. >>(4.S+9)    beshort        x        \b%d
  8644. >(4.S+5)    byte        0xC1        \b, extended sequential
  8645. >>(4.S+6)    byte        x        \b, precision %d
  8646. >>(4.S+7)    beshort        x        \b, %dx
  8647. >>(4.S+9)    beshort        x        \b%d
  8648. >(4.S+5)    byte        0xC2        \b, progressive
  8649. >>(4.S+6)    byte        x        \b, precision %d
  8650. >>(4.S+7)    beshort        x        \b, %dx
  8651. >>(4.S+9)    beshort        x        \b%d
  8652. # I've commented-out quantisation table reporting.  I doubt anyone cares yet.
  8653. #>(4.S+5)    byte        0xDB        \b, quantisation table
  8654. #>>(4.S+6)    beshort        x        \b length=%d
  8655. #>14    beshort        x        \b, %d x
  8656. #>16    beshort        x        \b %d
  8657.  
  8658. # HSI is Handmade Software's proprietary JPEG encoding scheme
  8659. 0    string        hsi1        JPEG image data, HSI proprietary
  8660.  
  8661. # From: David Santinoli <david@santinoli.com>
  8662. 0    string        \x00\x00\x00\x0C\x6A\x50\x20\x20\x0D\x0A\x87\x0A    JPEG 2000 image data
  8663.  
  8664. # Type: JPEG 2000 codesream
  8665. # From: Mathieu Malaterre <mathieu.malaterre@gmail.com>
  8666. 0    belong        0xff4fff51                        JPEG 2000 codestream
  8667. 45    beshort        0xff52
  8668.  
  8669. #------------------------------------------------------------------------------
  8670. # karma:  file(1) magic for Karma data files
  8671. #
  8672. # From <rgooch@atnf.csiro.au>
  8673.  
  8674. 0    string        KarmaRHD Version    Karma Data Structure Version
  8675. >16    belong        x        %lu
  8676.  
  8677. #------------------------------------------------------------------------------
  8678. # kde:  file(1) magic for KDE
  8679.  
  8680. 0        string    [KDE\ Desktop\ Entry]    KDE desktop entry
  8681. !:mime    application/x-kdelnk
  8682. 0        string    #\ KDE\ Config\ File    KDE config file
  8683. !:mime    application/x-kdelnk
  8684. 0        string    #\ xmcd    xmcd database file for kscd
  8685. !:mime    text/x-xmcd
  8686. #------------------------------------------------------------------------------
  8687. # DEC SRC Virtual Paper: Lectern files
  8688. # Karl M. Hegbloom <karlheg@inetarena.com>
  8689. 0    string    lect    DEC SRC Virtual Paper Lectern file
  8690. #------------------------------------------------------------------------------
  8691. # lex:  file(1) magic for lex
  8692. #
  8693. #    derived empirically, your offsets may vary!
  8694. 0    search/100    yyprevious    C program text (from lex)
  8695. >3    search/1    >\0         for %s
  8696. # C program text from GNU flex, from Daniel Quinlan <quinlan@yggdrasil.com>
  8697. 0    search/100    generated\ by\ flex    C program text (from flex)
  8698. # lex description file, from Daniel Quinlan <quinlan@yggdrasil.com>
  8699. 0    search/1    %{        lex description text
  8700.  
  8701. #------------------------------------------------------------------------------
  8702. # lif:  file(1) magic for lif
  8703. #
  8704. # (Daniel Quinlan <quinlan@yggdrasil.com>)
  8705. #
  8706. 0    beshort        0x8000        lif file
  8707. #------------------------------------------------------------------------------
  8708. # linux:  file(1) magic for Linux files
  8709. #
  8710. # Values for Linux/i386 binaries, from Daniel Quinlan <quinlan@yggdrasil.com>
  8711. # The following basic Linux magic is useful for reference, but using
  8712. # "long" magic is a better practice in order to avoid collisions.
  8713. #
  8714. # 2    leshort        100        Linux/i386
  8715. # >0    leshort        0407        impure executable (OMAGIC)
  8716. # >0    leshort        0410        pure executable (NMAGIC)
  8717. # >0    leshort        0413        demand-paged executable (ZMAGIC)
  8718. # >0    leshort        0314        demand-paged executable (QMAGIC)
  8719. #
  8720. 0    lelong        0x00640107    Linux/i386 impure executable (OMAGIC)
  8721. >16    lelong        0        \b, stripped
  8722. 0    lelong        0x00640108    Linux/i386 pure executable (NMAGIC)
  8723. >16    lelong        0        \b, stripped
  8724. 0    lelong        0x0064010b    Linux/i386 demand-paged executable (ZMAGIC)
  8725. >16    lelong        0        \b, stripped
  8726. 0    lelong        0x006400cc    Linux/i386 demand-paged executable (QMAGIC)
  8727. >16    lelong        0        \b, stripped
  8728. #
  8729. 0    string        \007\001\000    Linux/i386 object file
  8730. >20    lelong        >0x1020        \b, DLL library
  8731. # Linux-8086 stuff:
  8732. 0    string        \01\03\020\04    Linux-8086 impure executable
  8733. >28    long        !0        not stripped
  8734. 0    string        \01\03\040\04    Linux-8086 executable
  8735. >28    long        !0        not stripped
  8736. #
  8737. 0    string        \243\206\001\0    Linux-8086 object file
  8738. #
  8739. 0    string        \01\03\020\20    Minix-386 impure executable
  8740. >28    long        !0        not stripped
  8741. 0    string        \01\03\040\20    Minix-386 executable
  8742. >28    long        !0        not stripped
  8743. # core dump file, from Bill Reynolds <bill@goshawk.lanl.gov>
  8744. 216    lelong        0421        Linux/i386 core file
  8745. >220    string        >\0        of '%s'
  8746. >200    lelong        >0        (signal %d)
  8747. #
  8748. # LILO boot/chain loaders, from Daniel Quinlan <quinlan@yggdrasil.com>
  8749. # this can be overridden by the DOS executable (COM) entry
  8750. 2    string        LILO        Linux/i386 LILO boot/chain loader
  8751. #
  8752. # PSF fonts, from H. Peter Anvin <hpa@yggdrasil.com>
  8753. 0    leshort        0x0436        Linux/i386 PC Screen Font data,
  8754. >2    byte        0        256 characters, no directory,
  8755. >2    byte        1        512 characters, no directory,
  8756. >2    byte        2        256 characters, Unicode directory,
  8757. >2    byte        3        512 characters, Unicode directory,
  8758. >3    byte        >0        8x%d
  8759. # Linux swap file, from Daniel Quinlan <quinlan@yggdrasil.com>
  8760. 4086    string        SWAP-SPACE    Linux/i386 swap file
  8761. # From: Jeff Bailey <jbailey@ubuntu.com>
  8762. # Linux swap file with swsusp1 image, from Jeff Bailey <jbailey@ubuntu.com>
  8763. 4076    string        SWAPSPACE2S1SUSPEND    Linux/i386 swap file (new style) with SWSUSP1 image
  8764. # according to man page of mkswap (8) March 1999
  8765. # volume label and UUID Russell Coker
  8766. # http://etbe.coker.com.au/2008/07/08/label-vs-uuid-vs-device/
  8767. 4086    string        SWAPSPACE2    Linux/i386 swap file (new style),
  8768. >0x400    long        x        version %d (4K pages),
  8769. >0x404    long        x        size %d pages,
  8770. >1052    string        \0        no label,
  8771. >1052    string        >\0        LABEL=%s,
  8772. >0x40c    belong        x        UUID=%x
  8773. >0x410    beshort        x        \b-%x
  8774. >0x412    beshort        x        \b-%x
  8775. >0x414    beshort        x        \b-%x
  8776. >0x416    belong        x        \b-%x
  8777. >0x41a    beshort        x        \b%x
  8778. # ECOFF magic for OSF/1 and Linux (only tested under Linux though)
  8779. #
  8780. #    from Erik Troan (ewt@redhat.com) examining od dumps, so this
  8781. #        could be wrong
  8782. #      updated by David Mosberger (davidm@azstarnet.com) based on
  8783. #      GNU BFD and MIPS info found below.
  8784. #
  8785. 0    leshort        0x0183        ECOFF alpha
  8786. >24    leshort        0407        executable
  8787. >24    leshort        0410        pure
  8788. >24    leshort        0413        demand paged
  8789. >8    long        >0        not stripped
  8790. >8    long        0        stripped
  8791. >23    leshort        >0        - version %ld.
  8792. #
  8793. # Linux kernel boot images, from Albert Cahalan <acahalan@cs.uml.edu>
  8794. # and others such as Axel Kohlmeyer <akohlmey@rincewind.chemie.uni-ulm.de>
  8795. # and NicolĀ·s Lichtmaier <nick@debian.org>
  8796. # All known start with: b8 c0 07 8e d8 b8 00 90 8e c0 b9 00 01 29 f6 29
  8797. # Linux kernel boot images (i386 arch) (Wolfram Kleff)
  8798. 514    string        HdrS        Linux kernel
  8799. >510    leshort        0xAA55        x86 boot executable
  8800. >>518    leshort        >0x1ff
  8801. >>529    byte        0        zImage,
  8802. >>>529    byte        1        bzImage,
  8803. >>>(526.s+0x200) string    >\0        version %s,
  8804. >>498    leshort        1        RO-rootFS,
  8805. >>498    leshort        0        RW-rootFS,
  8806. >>508    leshort        >0        root_dev 0x%X,
  8807. >>502    leshort        >0        swap_dev 0x%X,
  8808. >>504    leshort        >0        RAMdisksize %u KB,
  8809. >>506    leshort        0xFFFF        Normal VGA
  8810. >>506    leshort        0xFFFE        Extended VGA
  8811. >>506    leshort        0xFFFD        Prompt for Videomode
  8812. >>506    leshort        >0        Video mode %d
  8813. # This also matches new kernels, which were caught above by "HdrS".
  8814. 0        belong    0xb8c0078e    Linux kernel
  8815. >0x1e3        string    Loading        version 1.3.79 or older
  8816. >0x1e9        string    Loading        from prehistoric times
  8817.  
  8818. # System.map files - NicolĀ·s Lichtmaier <nick@debian.org>
  8819. 8    search/1    \ A\ _text    Linux kernel symbol map text
  8820.  
  8821. # LSM entries - NicolĀ·s Lichtmaier <nick@debian.org>
  8822. 0    search/1    Begin3    Linux Software Map entry text
  8823. 0    search/1    Begin4    Linux Software Map entry text (new format)
  8824.  
  8825. # From Matt Zimmerman, enhanced for v3 by Matthew Palmer
  8826. 0    belong    0x4f4f4f4d    User-mode Linux COW file
  8827. >4    belong    <3        \b, version %d
  8828. >>8    string    >\0        \b, backing file %s
  8829. >4    belong    >2        \b, version %d
  8830. >>32    string    >\0        \b, backing file %s
  8831.  
  8832. ############################################################################
  8833. # Linux kernel versions
  8834.  
  8835. 0        string        \xb8\xc0\x07\x8e\xd8\xb8\x00\x90    Linux
  8836. >497        leshort        0        x86 boot sector
  8837. >>514        belong        0x8e    of a kernel from the dawn of time!
  8838. >>514        belong        0x908ed8b4    version 0.99-1.1.42
  8839. >>514        belong        0x908ed8b8    for memtest86
  8840.  
  8841. >497        leshort        !0        x86 kernel
  8842. >>504        leshort        >0        RAMdisksize=%u KB
  8843. >>502        leshort        >0        swap=0x%X
  8844. >>508        leshort        >0        root=0x%X
  8845. >>>498        leshort        1        \b-ro
  8846. >>>498        leshort        0        \b-rw
  8847. >>506        leshort        0xFFFF        vga=normal
  8848. >>506        leshort        0xFFFE        vga=extended
  8849. >>506        leshort        0xFFFD        vga=ask
  8850. >>506        leshort        >0        vga=%d
  8851. >>514        belong        0x908ed881    version 1.1.43-1.1.45
  8852. >>514        belong        0x15b281cd
  8853. >>>0xa8e    belong        0x55AA5a5a    version 1.1.46-1.2.13,1.3.0
  8854. >>>0xa99    belong        0x55AA5a5a    version 1.3.1,2
  8855. >>>0xaa3    belong        0x55AA5a5a    version 1.3.3-1.3.30
  8856. >>>0xaa6    belong        0x55AA5a5a    version 1.3.31-1.3.41
  8857. >>>0xb2b    belong        0x55AA5a5a    version 1.3.42-1.3.45
  8858. >>>0xaf7    belong        0x55AA5a5a    version 1.3.46-1.3.72
  8859. >>514        string        HdrS
  8860. >>>518        leshort        >0x1FF
  8861. >>>>529        byte        0        \b, zImage
  8862. >>>>529        byte        1        \b, bzImage
  8863. >>>>(526.s+0x200) string     >\0        \b, version %s
  8864.  
  8865. # Linux boot sector thefts.
  8866. 0        belong        0xb8c0078e    Linux
  8867. >0x1e6        belong        0x454c4b53    ELKS Kernel
  8868. >0x1e6        belong        !0x454c4b53    style boot sector
  8869.  
  8870. ############################################################################
  8871. # Linux 8086 executable
  8872. 0    lelong&0xFF0000FF 0xC30000E9    Linux-Dev86 executable, headerless
  8873. >5    string        .        
  8874. >>4    string        >\0        \b, libc version %s
  8875.  
  8876. 0    lelong&0xFF00FFFF 0x4000301    Linux-8086 executable
  8877. >2    byte&0x01    !0        \b, unmapped zero page
  8878. >2    byte&0x20    0        \b, impure
  8879. >2    byte&0x20    !0
  8880. >>2    byte&0x10    !0        \b, A_EXEC
  8881. >2    byte&0x02    !0        \b, A_PAL
  8882. >2    byte&0x04    !0        \b, A_NSYM
  8883. >2    byte&0x08    !0        \b, A_STAND
  8884. >2    byte&0x40    !0        \b, A_PURE
  8885. >2    byte&0x80    !0        \b, A_TOVLY
  8886. >28     long            !0              \b, not stripped
  8887. >37    string        .        
  8888. >>36    string        >\0        \b, libc version %s
  8889.  
  8890. # 0    lelong&0xFF00FFFF 0x10000301    ld86 I80386 executable
  8891. # 0    lelong&0xFF00FFFF 0xB000301    ld86 M68K executable
  8892. # 0    lelong&0xFF00FFFF 0xC000301    ld86 NS16K executable
  8893. # 0    lelong&0xFF00FFFF 0x17000301    ld86 SPARC executable
  8894.  
  8895. # SYSLINUX boot logo files (from 'ppmtolss16' sources)
  8896. # http://syslinux.zytor.com/
  8897. #
  8898. 0    lelong    =0x1413f33d        SYSLINUX' LSS16 image data
  8899. >4    leshort    x            \b, width %d
  8900. >6    leshort    x            \b, height %d
  8901.  
  8902. 0    string    OOOM            User-Mode-Linux's Copy-On-Write disk image
  8903. >4    belong    x            version %d
  8904.  
  8905. # SE Linux policy database
  8906. # From: Mike Frysinger <vapier@gentoo.org>
  8907. 0    lelong    0xf97cff8c        SE Linux policy
  8908. >16    lelong    x            v%d
  8909. >20    lelong    1            MLS
  8910. >24    lelong    x            %d symbols
  8911. >28    lelong    x            %d ocons
  8912.  
  8913. # Linux Logical Volume Manager (LVM) 
  8914. # Emmanuel VARAGNAT <emmanuel.varagnat@guzu.net>
  8915. #
  8916. # System ID, UUID and volume group name are 128 bytes long
  8917. # but they should never be full and initialized with zeros...
  8918. #
  8919. # LVM1
  8920. #
  8921. 0x0    string    HM\001        LVM1 (Linux Logical Volume Manager), version 1
  8922. >0x12c    string    >\0        , System ID: %s
  8923.  
  8924. 0x0    string    HM\002        LVM1 (Linux Logical Volume Manager), version 2
  8925. >0x12c    string    >\0        , System ID: %s
  8926.  
  8927. #  LVM2
  8928. #
  8929. # It seems that the label header can be in one the four first sector
  8930. # of the disk... (from _find_labeller in lib/label/label.c of LVM2)
  8931. #
  8932. # 0x200 seems to be the common case
  8933.  
  8934. 0x218         string    LVM2\ 001    LVM2 (Linux Logical Volume Manager)
  8935. # read the offset to add to the start of the header, and the header
  8936. # start in 0x200
  8937. >(0x214.l+0x200) string    >\0        , UUID: %s
  8938.  
  8939. 0x018         string    LVM2\ 001    LVM2 (Linux Logical Volume Manager)
  8940. >(0x014.l)     string    >\0        , UUID: %s
  8941.  
  8942. 0x418         string    LVM2\ 001    LVM2 (Linux Logical Volume Manager)
  8943. >(0x414.l+0x400) string    >\0        , UUID: %s
  8944.  
  8945. 0x618         string    LVM2\ 001    LVM2 (Linux Logical Volume Manager)
  8946. >(0x614.l+0x600) string    >\0        , UUID: %s
  8947.  
  8948. # LVM snapshot
  8949. # from Jason Farrel
  8950. 0    string    SnAp    LVM Snapshot (CopyOnWrite store)
  8951. >4    lelong    !0    - valid,
  8952. >4    lelong    0    - invalid,
  8953. >8    lelong    x    version %d,
  8954. >12    lelong    x    chunk_size %d
  8955.  
  8956. # SE Linux policy database
  8957. 0    lelong    0xf97cff8c        SE Linux policy
  8958. >16    lelong    x            v%d
  8959. >20    lelong    1            MLS
  8960. >24    lelong    x            %d symbols
  8961. >28    lelong    x            %d ocons
  8962.  
  8963. # LUKS: Linux Unified Key Setup, On-Disk Format, http://luks.endorphin.org/spec
  8964. # Anthon van der Neut (anthon@mnt.org)
  8965. 0    string    LUKS\xba\xbe    LUKS encrypted file,
  8966. >6    beshort x        ver %d
  8967. >8    string    x        [%s,
  8968. >40    string    x        %s,
  8969. >72    string    x        %s]
  8970. >168    string    x        UUID: %s
  8971.  
  8972.  
  8973. # Summary: Xen saved domain file
  8974. # Created by: Radek Vokal <rvokal@redhat.com>
  8975. 0    string        LinuxGuestRecord    Xen saved domain
  8976. >20    search/256    (name            
  8977. >>&1    string        x            (name %s)
  8978.  
  8979. # Type: Xen, the virtual machine monitor
  8980. # From: Radek Vokal <rvokal@redhat.com>
  8981. 0    string        LinuxGuestRecord    Xen saved domain
  8982. #>2    regex        \(name\ [^)]*\)        %s
  8983. >20    search/256    (name            (name
  8984. >>&1    string        x            %s...)
  8985. #------------------------------------------------------------------------------
  8986. # lisp:  file(1) magic for lisp programs
  8987. #
  8988. # various lisp types, from Daniel Quinlan (quinlan@yggdrasil.com)
  8989.  
  8990. # updated by Joerg Jenderek
  8991. # GRR: This lot is too weak
  8992. #0    string    ;;            
  8993. # windows INF files often begin with semicolon and use CRLF as line end
  8994. # lisp files are mainly created on unix system with LF as line end
  8995. #>2    search/2048    !\r        Lisp/Scheme program text
  8996. #>2    search/2048    \r        Windows INF file
  8997.  
  8998. 0    search/256    (if\             Lisp/Scheme program text
  8999. !:mime    text/x-lisp
  9000. 0    search/256    (setq\             Lisp/Scheme program text
  9001. !:mime    text/x-lisp
  9002. 0    search/256    (defvar\         Lisp/Scheme program text
  9003. !:mime    text/x-lisp
  9004. 0    search/256    (defparam\         Lisp/Scheme program text
  9005. !:mime    text/x-lisp
  9006. 0    search/256    (defun\          Lisp/Scheme program text
  9007. !:mime    text/x-lisp
  9008. 0    search/256    (autoload\         Lisp/Scheme program text
  9009. !:mime    text/x-lisp
  9010. 0    search/256    (custom-set-variables\     Lisp/Scheme program text
  9011. !:mime    text/x-lisp
  9012.  
  9013. # Emacs 18 - this is always correct, but not very magical.
  9014. 0    string    \012(            Emacs v18 byte-compiled Lisp data
  9015. !:mime    application/x-elc
  9016. # Emacs 19+ - ver. recognition added by Ian Springer
  9017. # Also applies to XEmacs 19+ .elc files; could tell them apart with regexs
  9018. # - Chris Chittleborough <cchittleborough@yahoo.com.au>
  9019. 0    string    ;ELC    
  9020. >4    byte    >18            
  9021. >4    byte    <32            Emacs/XEmacs v%d byte-compiled Lisp data
  9022. !:mime    application/x-elc        
  9023.  
  9024. # Files produced by CLISP Common Lisp From: Bruno Haible <haible@ilog.fr>
  9025. 0    string    (SYSTEM::VERSION\040'    CLISP byte-compiled Lisp program (pre 2004-03-27)
  9026. 0    string    (|SYSTEM|::|VERSION|\040'    CLISP byte-compiled Lisp program text
  9027.  
  9028. 0    long    0x70768BD2        CLISP memory image data
  9029. 0    long    0xD28B7670        CLISP memory image data, other endian
  9030.  
  9031. #.com and .bin for MIT scheme 
  9032. 0    string    \372\372\372\372    MIT scheme (library?)
  9033.  
  9034. # From: David Allouche <david@allouche.net>
  9035. 0    search/1    \<TeXmacs|    TeXmacs document text
  9036. !:mime    text/texmacs
  9037.  
  9038. #------------------------------------------------------------------------------
  9039. # llvm:  file(1) magic for LLVM byte-codes
  9040. # URL:  http://llvm.org/docs/BitCodeFormat.html
  9041. # From: Al Stone <ahs3@fc.hp.com>
  9042.  
  9043. 0    string    llvm    LLVM byte-codes, uncompressed
  9044. 0    string    llvc0    LLVM byte-codes, null compression
  9045. 0    string    llvc1    LLVM byte-codes, gzip compression
  9046. 0    string    llvc2    LLVM byte-codes, bzip2 compression
  9047. 0    string    \xde\xc0\x17\x0b    LLVM bitcode, wrapper
  9048. 0       string    BC\xc0\xde    LLVM bitcode
  9049. #------------------------------------------------------------------------------
  9050. # lua:  file(1) magic for Lua scripting language
  9051. # URL:  http://www.lua.org/
  9052. # From: Reuben Thomas <rrt@sc3d.org>, Seo Sanghyeon <tinuviel@sparcs.kaist.ac.kr>
  9053.  
  9054. # Lua scripts
  9055. 0    search/1/b    #!\ /usr/bin/lua    Lua script text executable
  9056. !:mime    text/x-lua
  9057. 0    search/1/b    #!\ /usr/local/bin/lua    Lua script text executable
  9058. !:mime    text/x-lua
  9059. 0    search/1    #!/usr/bin/env\ lua    Lua script text executable
  9060. !:mime    text/x-lua
  9061. 0    search/1    #!\ /usr/bin/env\ lua    Lua script text executable
  9062. !:mime    text/x-lua
  9063.  
  9064. # Lua bytecode
  9065. 0    string        \033Lua            Lua bytecode,
  9066. >4    byte        0x50            version 5.0
  9067. >4    byte        0x51            version 5.1
  9068.  
  9069. #------------------------------------------------------------------------------
  9070. # luks:  file(1) magic for Linux Unified Key Setup
  9071. # URL:    http://luks.endorphin.org/spec
  9072. # From:    Anthon van der Neut <anthon@mnt.org>
  9073.  
  9074. 0    string        LUKS\xba\xbe    LUKS encrypted file,
  9075. >6    beshort        x        ver %d
  9076. >8    string        x        [%s,
  9077. >40    string        x        %s,
  9078. >72    string        x        %s]
  9079. >168    string        x        UUID: %s
  9080. #------------------------------------------------------------
  9081. # Mach has two magic numbers, 0xcafebabe and 0xfeedface.
  9082. # Unfortunately the first, cafebabe, is shared with
  9083. # Java ByteCode, so they are both handled in the file "cafebabe".
  9084. # The "feedface" ones are handled herein.
  9085. #------------------------------------------------------------
  9086. 0    lelong&0xfeffffff    0xfeedface    Mach-O
  9087. >0    byte        0xcf        64-bit
  9088. >12    lelong        1        object
  9089. >12    lelong        2        executable
  9090. >12    lelong        3        fixed virtual memory shared library
  9091. >12    lelong        4        core
  9092. >12    lelong        5        preload executable
  9093. >12    lelong        6        dynamically linked shared library
  9094. >12    lelong        7        dynamic linker
  9095. >12    lelong        8        bundle
  9096. >12    lelong        9        dynamically linked shared library stub
  9097. >12    lelong        >9
  9098. >>12    lelong        x        filetype=%ld
  9099. >4    lelong        <0
  9100. >>4    lelong        x        architecture=%ld
  9101. >4    lelong        1        vax
  9102. >4    lelong        2        romp
  9103. >4    lelong        3        architecture=3
  9104. >4    lelong        4        ns32032
  9105. >4    lelong        5        ns32332
  9106. >4    lelong        6        m68k
  9107. >4    lelong        7        i386
  9108. >4    lelong        8        mips
  9109. >4    lelong        9        ns32532
  9110. >4    lelong        10        architecture=10
  9111. >4    lelong        11        hppa
  9112. >4    lelong        12        acorn
  9113. >4    lelong        13        m88k
  9114. >4    lelong        14        sparc
  9115. >4    lelong        15        i860-big
  9116. >4    lelong        16        i860
  9117. >4    lelong        17        rs6000
  9118. >4    lelong        18        ppc
  9119. >4    lelong        16777234    ppc64
  9120. >4    lelong        >16777234
  9121. >>4    lelong        x        architecture=%ld
  9122. #
  9123. 0    belong&0xfffffffe    0xfeedface    Mach-O
  9124. >3    byte        0xcf        64-bit
  9125. >12    belong        1        object
  9126. >12    belong        2        executable
  9127. >12    belong        3        fixed virtual memory shared library
  9128. >12    belong        4        core
  9129. >12    belong        5        preload executable
  9130. >12    belong        6               dynamically linked shared library
  9131. >12    belong        7               dynamic linker
  9132. >12    belong        8        bundle
  9133. >12    belong        9        dynamically linked shared library stub
  9134. >12    belong        >9
  9135. >>12    belong        x        filetype=%ld
  9136. >4    belong        <0
  9137. >>4    belong        x        architecture=%ld
  9138. >4    belong        1        vax
  9139. >4    belong        2        romp
  9140. >4    belong        3        architecture=3
  9141. >4    belong        4        ns32032
  9142. >4    belong        5        ns32332
  9143. >4    belong        6        for m68k architecture
  9144. # from NeXTstep 3.0 <mach/machine.h>
  9145. # i.e. mc680x0_all, ignore
  9146. # >>8    belong        1        (mc68030)
  9147. >>8    belong        2        (mc68040)
  9148. >>8    belong        3        (mc68030 only)
  9149. >4    belong        7        i386
  9150. >4    belong        8        mips
  9151. >4    belong        9        ns32532
  9152. >4    belong        10        architecture=10
  9153. >4    belong        11        hppa
  9154. >4    belong        12        acorn
  9155. >4    belong        13        m88k
  9156. >4    belong        14        sparc
  9157. >4    belong        15        i860-big
  9158. >4    belong        16        i860
  9159. >4    belong        17        rs6000
  9160. >4    belong        18        ppc
  9161. >4    belong        16777234    ppc64
  9162. >4    belong        >16777234
  9163. >>4    belong        x        architecture=%ld
  9164.  
  9165. #------------------------------------------------------------------------------
  9166. # macintosh description
  9167. #
  9168. # BinHex is the Macintosh ASCII-encoded file format (see also "apple")
  9169. # Daniel Quinlan, quinlan@yggdrasil.com
  9170. 11    string    must\ be\ converted\ with\ BinHex    BinHex binary text
  9171. !:mime    application/mac-binhex40
  9172. >41    string    x                    \b, version %.3s
  9173.  
  9174. # Stuffit archives are the de facto standard of compression for Macintosh
  9175. # files obtained from most archives. (franklsm@tuns.ca)
  9176. 0    string        SIT!            StuffIt Archive (data)
  9177. >2    string        x            : %s
  9178. 0    string        SITD            StuffIt Deluxe (data)
  9179. >2    string        x            : %s
  9180. 0    string        Seg            StuffIt Deluxe Segment (data)
  9181. >2    string        x            : %s
  9182.  
  9183. # Newer StuffIt archives (grant@netbsd.org)
  9184. 0    string        StuffIt            StuffIt Archive
  9185. !:mime    application/x-stuffit
  9186. #>162    string        >0            : %s
  9187.  
  9188. # Macintosh Applications and Installation binaries (franklsm@tuns.ca)
  9189. # GRR: Too weak
  9190. #0    string        APPL            Macintosh Application (data)
  9191. #>2    string        x            \b: %s
  9192.  
  9193. # Macintosh System files (franklsm@tuns.ca)
  9194. # GRR: Too weak
  9195. #0    string        zsys            Macintosh System File (data)
  9196. #0    string        FNDR            Macintosh Finder (data)
  9197. #0    string        libr            Macintosh Library (data)
  9198. #>2    string        x            : %s
  9199. #0    string        shlb            Macintosh Shared Library (data)
  9200. #>2    string        x            : %s
  9201. #0    string        cdev            Macintosh Control Panel (data)
  9202. #>2    string        x            : %s
  9203. #0    string        INIT            Macintosh Extension (data)
  9204. #>2    string        x            : %s
  9205. #0    string        FFIL            Macintosh Truetype Font (data)
  9206. #>2    string        x            : %s
  9207. #0    string        LWFN            Macintosh Postscript Font (data)
  9208. #>2    string        x            : %s
  9209.  
  9210. # Additional Macintosh Files (franklsm@tuns.ca)
  9211. # GRR: Too weak
  9212. #0    string        PACT            Macintosh Compact Pro Archive (data)
  9213. #>2    string        x            : %s
  9214. #0    string        ttro            Macintosh TeachText File (data)
  9215. #>2    string        x            : %s
  9216. #0    string        TEXT            Macintosh TeachText File (data)
  9217. #>2    string        x            : %s
  9218. #0    string        PDF            Macintosh PDF File (data)
  9219. #>2    string        x            : %s
  9220.  
  9221. # MacBinary format (Eric Fischer, enf@pobox.com)
  9222. #
  9223. # Unfortunately MacBinary doesn't really have a magic number prior
  9224. # to the MacBinary III format.  The checksum is really the way to
  9225. # do it, but the magic file format isn't up to the challenge.
  9226. #
  9227. # 0    byte        0
  9228. # 1    byte                # filename length
  9229. # 2    string                # filename
  9230. # 65    string                # file type
  9231. # 69    string                # file creator
  9232. # 73    byte                # Finder flags
  9233. # 74    byte        0
  9234. # 75    beshort                # vertical posn in window
  9235. # 77    beshort                # horiz posn in window
  9236. # 79    beshort                # window or folder ID
  9237. # 81    byte                # protected?
  9238. # 82    byte        0
  9239. # 83    belong                # length of data segment
  9240. # 87    belong                # length of resource segment
  9241. # 91    belong                # file creation date
  9242. # 95    belong                # file modification date
  9243. # 99    beshort                # length of comment after resource
  9244. # 101    byte                # new Finder flags
  9245. # 102    string        mBIN        # (only in MacBinary III)
  9246. # 106    byte                # char. code of file name
  9247. # 107    byte                # still more Finder flags
  9248. # 116    belong                # total file length
  9249. # 120    beshort                # length of add'l header
  9250. # 122    byte        129        # for MacBinary II
  9251. # 122    byte        130        # for MacBinary III
  9252. # 123    byte        129        # minimum version that can read fmt
  9253. # 124    beshort                # checksum
  9254. #
  9255. # This attempts to use the version numbers as a magic number, requiring
  9256. # that the first one be 0x80, 0x81, 0x82, or 0x83, and that the second
  9257. # be 0x81.  This works for the files I have, but maybe not for everyone's.
  9258.  
  9259. # Unfortunately, this magic is quite weak - MPi
  9260. #122    beshort&0xFCFF    0x8081        Macintosh MacBinary data
  9261.  
  9262. # MacBinary I doesn't have the version number field at all, but MacBinary II
  9263. # has been in use since 1987 so I hope there aren't many really old files
  9264. # floating around that this will miss.  The original spec calls for using
  9265. # the nulls in 0, 74, and 82 as the magic number.
  9266. #
  9267. # Another possibility, that would also work for MacBinary I, is to use
  9268. # the assumption that 65-72 will all be ASCII (0x20-0x7F), that 73 will
  9269. # have bits 1 (changed), 2 (busy), 3 (bozo), and 6 (invisible) unset,
  9270. # and that 74 will be 0.  So something like
  9271. # 71     belong&0x80804EFF 0x00000000     Macintosh MacBinary data
  9272. # >73    byte&0x01    0x01        \b, inited
  9273. # >73    byte&0x02    0x02        \b, changed
  9274. # >73    byte&0x04    0x04        \b, busy
  9275. # >73    byte&0x08    0x08        \b, bozo
  9276. # >73    byte&0x10    0x10        \b, system
  9277. # >73    byte&0x10    0x20        \b, bundle
  9278. # >73    byte&0x10    0x40        \b, invisible
  9279. # >73    byte&0x10    0x80        \b, locked
  9280.  
  9281. #>65    string        x        \b, type "%4.4s"
  9282.  
  9283. #>65    string        8BIM        (PhotoShop)
  9284. #>65    string        ALB3        (PageMaker 3)
  9285. #>65    string        ALB4        (PageMaker 4)
  9286. #>65    string        ALT3        (PageMaker 3)
  9287. #>65    string        APPL        (application)
  9288. #>65    string        AWWP        (AppleWorks word processor)
  9289. #>65    string        CIRC        (simulated circuit)
  9290. #>65    string        DRWG        (MacDraw)
  9291. #>65    string        EPSF        (Encapsulated PostScript)
  9292. #>65    string        FFIL        (font suitcase)
  9293. #>65    string        FKEY        (function key)
  9294. #>65    string        FNDR        (Macintosh Finder)
  9295. #>65    string        GIFf        (GIF image)
  9296. #>65    string        Gzip        (GNU gzip)
  9297. #>65    string        INIT        (system extension)
  9298. #>65    string        LIB\         (library)
  9299. #>65    string        LWFN        (PostScript font)
  9300. #>65    string        MSBC        (Microsoft BASIC)
  9301. #>65    string        PACT        (Compact Pro archive)
  9302. #>65    string        PDF\         (Portable Document Format)
  9303. #>65    string        PICT        (picture)
  9304. #>65    string        PNTG        (MacPaint picture)
  9305. #>65    string        PREF        (preferences)
  9306. #>65    string        PROJ        (Think C project)
  9307. #>65    string        QPRJ        (Think Pascal project)
  9308. #>65    string        SCFL        (Defender scores)
  9309. #>65    string        SCRN        (startup screen)
  9310. #>65    string        SITD        (StuffIt Deluxe)
  9311. #>65    string        SPn3        (SuperPaint)
  9312. #>65    string        STAK        (HyperCard stack)
  9313. #>65    string        Seg\         (StuffIt segment)
  9314. #>65    string        TARF        (Unix tar archive)
  9315. #>65    string        TEXT        (ASCII)
  9316. #>65    string        TIFF        (TIFF image)
  9317. #>65    string        TOVF        (Eudora table of contents)
  9318. #>65    string        WDBN        (Microsoft Word word processor)
  9319. #>65    string        WORD        (MacWrite word processor)
  9320. #>65    string        XLS\         (Microsoft Excel)
  9321. #>65    string        ZIVM        (compress (.Z))
  9322. #>65    string        ZSYS        (Pre-System 7 system file)
  9323. #>65    string        acf3        (Aldus FreeHand)
  9324. #>65    string        cdev        (control panel)
  9325. #>65    string        dfil        (Desk Acessory suitcase)
  9326. #>65    string        libr        (library)
  9327. #>65    string        nX^d        (WriteNow word processor)
  9328. #>65    string        nX^w        (WriteNow dictionary)
  9329. #>65    string        rsrc        (resource)
  9330. #>65    string        scbk        (Scrapbook)
  9331. #>65    string        shlb        (shared library)
  9332. #>65    string        ttro        (SimpleText read-only)
  9333. #>65    string        zsys        (system file)
  9334.  
  9335. #>69    string        x        \b, creator "%4.4s"
  9336.  
  9337. # Somewhere, Apple has a repository of registered Creator IDs.  These are
  9338. # just the ones that I happened to have files from and was able to identify.
  9339.  
  9340. #>69    string        8BIM        (Adobe Photoshop)
  9341. #>69    string        ALD3        (PageMaker 3)
  9342. #>69    string        ALD4        (PageMaker 4)
  9343. #>69    string        ALFA        (Alpha editor)
  9344. #>69    string        APLS        (Apple Scanner)
  9345. #>69    string        APSC        (Apple Scanner)
  9346. #>69    string        BRKL        (Brickles)
  9347. #>69    string        BTFT        (BitFont)
  9348. #>69    string        CCL2         (Common Lisp 2)
  9349. #>69    string        CCL\         (Common Lisp)
  9350. #>69    string        CDmo        (The Talking Moose)
  9351. #>69    string        CPCT        (Compact Pro)
  9352. #>69    string        CSOm        (Eudora)
  9353. #>69    string        DMOV        (Font/DA Mover)
  9354. #>69    string        DSIM        (DigSim)
  9355. #>69    string        EDIT        (Macintosh Edit)
  9356. #>69    string        ERIK        (Macintosh Finder)
  9357. #>69    string        EXTR        (self-extracting archive)
  9358. #>69    string        Gzip        (GNU gzip)
  9359. #>69    string        KAHL        (Think C)
  9360. #>69    string        LWFU        (LaserWriter Utility)
  9361. #>69    string        LZIV        (compress)
  9362. #>69    string        MACA        (MacWrite)
  9363. #>69    string        MACS        (Macintosh operating system)
  9364. #>69    string        MAcK        (MacKnowledge terminal emulator)
  9365. #>69    string        MLND        (Defender)
  9366. #>69    string        MPNT        (MacPaint)
  9367. #>69    string        MSBB        (Microsoft BASIC (binary))
  9368. #>69    string        MSWD        (Microsoft Word)
  9369. #>69    string        NCSA        (NCSA Telnet)
  9370. #>69    string        PJMM        (Think Pascal)
  9371. #>69    string        PSAL        (Hunt the Wumpus)
  9372. #>69    string        PSI2        (Apple File Exchange)
  9373. #>69    string        R*ch        (BBEdit)
  9374. #>69    string        RMKR        (Resource Maker)
  9375. #>69    string        RSED        (Resource Editor)
  9376. #>69    string        Rich        (BBEdit)
  9377. #>69    string        SIT!        (StuffIt)
  9378. #>69    string        SPNT        (SuperPaint)
  9379. #>69    string        Unix        (NeXT Mac filesystem)
  9380. #>69    string        VIM!        (Vim editor)
  9381. #>69    string        WILD        (HyperCard)
  9382. #>69    string        XCEL        (Microsoft Excel)
  9383. #>69    string        aCa2        (Fontographer)
  9384. #>69    string        aca3        (Aldus FreeHand)
  9385. #>69    string        dosa        (Macintosh MS-DOS file system)
  9386. #>69    string        movr        (Font/DA Mover)
  9387. #>69    string        nX^n        (WriteNow)
  9388. #>69    string        pdos        (Apple ProDOS file system)
  9389. #>69    string        scbk        (Scrapbook)
  9390. #>69    string        ttxt        (SimpleText)
  9391. #>69    string        ufox        (Foreign File Access)
  9392.  
  9393. # Just in case...
  9394.  
  9395. 102    string        mBIN        MacBinary III data with surprising version number
  9396.  
  9397. # sas magic from Bruce Foster (bef@nwu.edu)
  9398. #
  9399. #0    string        SAS        SAS
  9400. #>8    string        x        %s
  9401. 0    string        SAS        SAS
  9402. >24    string        DATA        data file
  9403. >24    string        CATALOG        catalog
  9404. >24    string        INDEX        data file index
  9405. >24    string        VIEW        data view
  9406. # sas 7+ magic from Reinhold Koch (reinhold.koch@roche.com)
  9407. #
  9408. 0x54    string          SAS             SAS 7+
  9409. >0x9C   string          DATA            data file
  9410. >0x9C   string          CATALOG         catalog
  9411. >0x9C   string          INDEX           data file index
  9412. >0x9C   string          VIEW            data view
  9413.  
  9414. # spss magic for SPSS system and portable files, 
  9415. #     from Bruce Foster (bef@nwu.edu).
  9416.  
  9417. 0    long        0xc1e2c3c9    SPSS Portable File
  9418. >40    string         x        %s
  9419.  
  9420. 0    string        $FL2        SPSS System File
  9421. >24    string        x        %s
  9422.  
  9423. # Macintosh filesystem data
  9424. # From "Tom N Harris" <telliamed@mac.com>
  9425. # Fixed HFS+ and Partition map magic: Ethan Benson <erbenson@alaska.net>
  9426. # The MacOS epoch begins on 1 Jan 1904 instead of 1 Jan 1970, so these
  9427. # entries depend on the data arithmetic added after v.35
  9428. # There's also some Pascal strings in here, ditto...
  9429.  
  9430. # The boot block signature, according to IM:Files, is 
  9431. # "for HFS volumes, this field always contains the value 0x4C4B."
  9432. # But if this is true for MFS or HFS+ volumes, I don't know.
  9433. # Alternatively, the boot block is supposed to be zeroed if it's
  9434. # unused, so a simply >0 should suffice.
  9435.  
  9436. 0x400    beshort            0xD2D7        Macintosh MFS data
  9437. >0    beshort            0x4C4B        (bootable)
  9438. >0x40a    beshort            &0x8000        (locked)
  9439. >0x402    beldate-0x7C25B080    x        created: %s,
  9440. >0x406    beldate-0x7C25B080    >0        last backup: %s,
  9441. >0x414    belong            x        block size: %d,
  9442. >0x412    beshort            x        number of blocks: %d,
  9443. >0x424    pstring            x        volume name: %s
  9444.  
  9445. # "BD" is has many false positives
  9446. #0x400    beshort            0x4244        Macintosh HFS data
  9447. #>0    beshort            0x4C4B        (bootable)
  9448. #>0x40a    beshort            &0x8000        (locked)
  9449. #>0x40a    beshort            ^0x0100        (mounted)
  9450. #>0x40a    beshort            &0x0200        (spared blocks)
  9451. #>0x40a    beshort            &0x0800        (unclean)
  9452. #>0x47C    beshort            0x482B        (Embedded HFS+ Volume)
  9453. #>0x402    beldate-0x7C25B080    x        created: %s,
  9454. #>0x406    beldate-0x7C25B080    x        last modified: %s,
  9455. #>0x440    beldate-0x7C25B080    >0        last backup: %s,
  9456. #>0x414    belong            x        block size: %d,
  9457. #>0x412    beshort            x        number of blocks: %d,
  9458. #>0x424    pstring            x        volume name: %s
  9459.  
  9460. 0x400    beshort            0x482B        Macintosh HFS Extended
  9461. >&0    beshort            x        version %d data
  9462. >0    beshort            0x4C4B        (bootable)
  9463. >0x404    belong            ^0x00000100    (mounted)
  9464. >&2    belong            &0x00000200    (spared blocks)
  9465. >&2    belong            &0x00000800    (unclean)
  9466. >&2    belong            &0x00008000    (locked)
  9467. >&6    string            x        last mounted by: '%.4s',
  9468. # really, that should be treated as a belong and we print a string
  9469. # based on the value. TN1150 only mentions '8.10' for "MacOS 8.1"
  9470. >&14    beldate-0x7C25B080    x        created: %s,
  9471. # only the creation date is local time, all other timestamps in HFS+ are UTC.
  9472. >&18    bedate-0x7C25B080    x        last modified: %s,
  9473. >&22    bedate-0x7C25B080    >0        last backup: %s,
  9474. >&26    bedate-0x7C25B080    >0        last checked: %s,
  9475. >&38    belong            x        block size: %d,
  9476. >&42    belong            x        number of blocks: %d,
  9477. >&46    belong            x        free blocks: %d
  9478.  
  9479. # I don't think this is really necessary since it doesn't do much and 
  9480. # anything with a valid driver descriptor will also have a valid
  9481. # partition map
  9482. #0        beshort        0x4552        Apple Device Driver data
  9483. #>&24        beshort        =1        \b, MacOS
  9484.  
  9485. # Is that the partition type a cstring or a pstring? Well, IM says "strings 
  9486. # shorter than 32 bytes must be terminated with NULL" so I'll treat it as a 
  9487. # cstring. Of course, partitions can contain more than four entries, but 
  9488. # what're you gonna do?
  9489. # GRR: This magic is too weak, it is just "PM"
  9490. #0x200        beshort        0x504D        Apple Partition data
  9491. #>0x2        beshort        x        (block size: %d):
  9492. #>0x230        string        x        first type: %s,
  9493. #>0x210        string        x        name: %s,
  9494. #>0x254        belong        x        number of blocks: %d,
  9495. #>0x400        beshort        0x504D        
  9496. #>>0x430        string        x        second type: %s,
  9497. #>>0x410        string        x        name: %s,
  9498. #>>0x454        belong        x        number of blocks: %d,
  9499. #>>0x600        beshort        0x504D
  9500. #>>>0x630    string        x        third type: %s,
  9501. #>>>0x610    string        x        name: %s,
  9502. #>>>0x654    belong        x        number of blocks: %d,
  9503. #>>0x800        beshort        0x504D        
  9504. #>>>0x830    string        x        fourth type: %s,
  9505. #>>>0x810    string        x        name: %s,
  9506. #>>>0x854    belong        x        number of blocks: %d,
  9507. #>>>0xa00    beshort        0x504D        
  9508. #>>>>0xa30    string        x        fifth type: %s,
  9509. #>>>>0xa10    string        x        name: %s,
  9510. #>>>>0xa54    belong        x        number of blocks: %d
  9511. #>>>0xc00    beshort        0x504D
  9512. #>>>>0xc30    string        x        sixth type: %s,
  9513. #>>>>0xc10    string        x        name: %s,
  9514. #>>>>0xc54    belong        x        number of blocks: %d
  9515. ## AFAIK, only the signature is different
  9516. #0x200        beshort        0x5453        Apple Old Partition data
  9517. #>0x2        beshort        x        block size: %d,
  9518. #>0x230        string        x        first type: %s,
  9519. #>0x210        string        x        name: %s,
  9520. #>0x254        belong        x        number of blocks: %d,
  9521. #>0x400        beshort        0x504D        
  9522. #>>0x430        string        x        second type: %s,
  9523. #>>0x410        string        x        name: %s,
  9524. #>>0x454        belong        x        number of blocks: %d,
  9525. #>>0x800        beshort        0x504D        
  9526. #>>>0x830    string        x        third type: %s,
  9527. #>>>0x810    string        x        name: %s,
  9528. #>>>0x854    belong        x        number of blocks: %d,
  9529. #>>>0xa00    beshort        0x504D        
  9530. #>>>>0xa30    string        x        fourth type: %s,
  9531. #>>>>0xa10    string        x        name: %s,
  9532. #>>>>0xa54    belong        x        number of blocks: %d
  9533.  
  9534. # From: Remi Mommsen <mommsen@slac.stanford.edu>
  9535. 0        string        BOMStore    Mac OS X bill of materials (BOM) file
  9536.  
  9537. #------------------------------------------------------------------------------
  9538. # magic:  file(1) magic for magic files
  9539. #
  9540. 0    string        #\ Magic    magic text file for file(1) cmd
  9541. 0    lelong        0xF11E041C    magic binary file for file(1) cmd
  9542. >4    lelong        x        (version %d) (little endian)
  9543. 0    belong        0xF11E041C    magic binary file for file(1) cmd
  9544. >4    belong        x        (version %d) (big endian)
  9545. #------------------------------------------------------------------------------
  9546. # mail.news:  file(1) magic for mail and news
  9547. #
  9548. # Unfortunately, saved netnews also has From line added in some news software.
  9549. #0    string        From         mail text
  9550. # There are tests to ascmagic.c to cope with mail and news.
  9551. 0    string        Relay-Version:     old news text
  9552. !:mime    message/rfc822
  9553. 0    string        #!\ rnews    batched news text
  9554. !:mime    message/rfc822
  9555. 0    string        N#!\ rnews    mailed, batched news text
  9556. !:mime    message/rfc822
  9557. 0    string        Forward\ to     mail forwarding text
  9558. !:mime    message/rfc822
  9559. 0    string        Pipe\ to     mail piping text
  9560. !:mime    message/rfc822
  9561. 0    string        Return-Path:    smtp mail text
  9562. !:mime    message/rfc822
  9563. 0    string        Path:        news text
  9564. !:mime    message/news
  9565. 0    string        Xref:        news text
  9566. !:mime    message/news
  9567. 0    string        From:        news or mail text
  9568. !:mime    message/rfc822
  9569. 0    string        Article     saved news text
  9570. !:mime    message/news
  9571. 0    string        BABYL        Emacs RMAIL text
  9572. 0    string        Received:    RFC 822 mail text
  9573. !:mime    message/rfc822
  9574. 0    string        MIME-Version:    MIME entity text
  9575. #0    string        Content-    MIME entity text
  9576.  
  9577. # TNEF files...
  9578. 0    lelong        0x223E9F78    Transport Neutral Encapsulation Format
  9579.  
  9580. # From: Kevin Sullivan <ksulliva@psc.edu>
  9581. 0    string        *mbx*        MBX mail folder
  9582.  
  9583. # From: Simon Matter <simon.matter@invoca.ch>
  9584. 0    string        \241\002\213\015skiplist\ file\0\0\0    Cyrus skiplist DB
  9585.  
  9586. # JAM(mbp) Fidonet message area databases
  9587. # JHR file
  9588. 0    string    JAM\0            JAM message area header file
  9589. >12    leshort >0            (%d messages)
  9590.  
  9591. # Squish Fidonet message area databases
  9592. # SQD file (requires at least one message in the area)
  9593. # XXX: Weak magic
  9594. #256    leshort    0xAFAE4453        Squish message area data file
  9595. #>4    leshort    >0            (%d messages)
  9596.  
  9597. #0    string        \<!--\ MHonArc        text/html; x-type=mhonarc
  9598.  
  9599. #------------------------------------------------------------------------------
  9600. # maple:  file(1) magic for maple files
  9601. # "H. Nanosecond" <aldomel@ix.netcom.com>
  9602. # Maple V release 4, a multi-purpose math program
  9603. #
  9604.  
  9605. # maple library .lib
  9606. 0    string    \000MVR4\nI    MapleVr4 library
  9607.  
  9608. # .ind
  9609. # no magic for these :-(
  9610. # they are compiled indexes for maple files
  9611.  
  9612. # .hdb 
  9613. 0    string    \000\004\000\000    Maple help database
  9614.  
  9615. # .mhp
  9616. # this has the form <PACKAGE=name>
  9617. 0    string    \<PACKAGE=    Maple help file
  9618. 0    string    \<HELP\ NAME=    Maple help file
  9619. 0    string    \n\<HELP\ NAME=    Maple help file with extra carriage return at start (yuck)
  9620. #0    string    #\ Newton    Maple help file, old style
  9621. 0    string    #\ daub    Maple help file, old style
  9622. #0    string    #===========    Maple help file, old style
  9623.  
  9624. # .mws
  9625. 0    string    \000\000\001\044\000\221    Maple worksheet
  9626. #this is anomalous
  9627. 0    string    WriteNow\000\002\000\001\000\000\000\000\100\000\000\000\000\000    Maple worksheet, but weird
  9628. # this has the form {VERSION 2 3 "IBM INTEL NT" "2.3" }\n
  9629. # that is {VERSION major_version miunor_version computer_type version_string}
  9630. 0    string    {VERSION\     Maple worksheet
  9631. >9    string    >\0    version %.1s.
  9632. >>>11    string    >\0    %.1s
  9633.  
  9634. # .mps
  9635. 0    string    \0\0\001$    Maple something
  9636. # from byte 4 it is either 'nul E' or 'soh R'
  9637. # I think 'nul E' means a file that was saved as  a different name
  9638. # a sort of revision marking
  9639. # 'soh R' means new 
  9640. >4    string    \000\105    An old revision
  9641. >4    string    \001\122    The latest save
  9642.  
  9643. # .mpl
  9644. # some of these are the same as .mps above
  9645. #0000000 000 000 001 044 000 105 same as .mps
  9646. #0000000 000 000 001 044 001 122 same as .mps
  9647.  
  9648. 0    string    #\n##\ <SHAREFILE=    Maple something
  9649. 0    string    \n#\n##\ <SHAREFILE=    Maple something
  9650. 0    string    ##\ <SHAREFILE=    Maple something
  9651. 0    string    #\r##\ <SHAREFILE=    Maple something
  9652. 0    string    \r#\r##\ <SHAREFILE=    Maple something
  9653. 0    string    #\ \r##\ <DESCRIBE>    Maple something anomalous.
  9654.  
  9655. #------------------------------------------------------------------------------
  9656. # mathcad:  file(1) magic for Mathcad documents
  9657. # URL:    http://www.mathsoft.com/
  9658. # From:    Josh Triplett <josh@freedesktop.org>
  9659.  
  9660. 0    string    .MCAD\t        Mathcad document
  9661. #------------------------------------------------------------------------------
  9662. # mathematica:  file(1) magic for mathematica files
  9663. # "H. Nanosecond" <aldomel@ix.netcom.com>
  9664. # Mathematica a multi-purpose math program
  9665. # versions 2.2 and 3.0
  9666.  
  9667. #mathematica .mb
  9668. 0    string    \064\024\012\000\035\000\000\000    Mathematica version 2 notebook
  9669. 0    string    \064\024\011\000\035\000\000\000    Mathematica version 2 notebook
  9670.  
  9671. # .ma
  9672. # multiple possibilites:
  9673.  
  9674. 0    string    (*^\n\n::[\011frontEndVersion\ =\     Mathematica notebook
  9675. #>41    string    >\0    %s
  9676.  
  9677. #0    string    (*^\n\n::[\011palette    Mathematica notebook version 2.x
  9678.  
  9679. #0    string    (*^\n\n::[\011Information    Mathematica notebook version 2.x
  9680. #>675    string    >\0    %s #doesn't work well
  9681.  
  9682. # there may be 'cr' instread of 'nl' in some does this matter?
  9683.  
  9684. # generic:
  9685. 0    string    (*^\r\r::[\011    Mathematica notebook version 2.x
  9686. 0    string    (*^\r\n\r\n::[\011    Mathematica notebook version 2.x
  9687. 0    string    (*^\015            Mathematica notebook version 2.x
  9688. 0    string    (*^\n\r\n\r::[\011    Mathematica notebook version 2.x
  9689. 0    string    (*^\r::[\011    Mathematica notebook version 2.x
  9690. 0    string    (*^\r\n::[\011    Mathematica notebook version 2.x
  9691. 0    string    (*^\n\n::[\011    Mathematica notebook version 2.x
  9692. 0    string    (*^\n::[\011    Mathematica notebook version 2.x
  9693.  
  9694.  
  9695. # Mathematica .mx files
  9696.  
  9697. #0    string    (*This\ is\ a\ Mathematica\ binary\ dump\ file.\ It\ can\ be\ loaded\ with\ Get.*)    Mathematica binary file
  9698. 0    string    (*This\ is\ a\ Mathematica\ binary\     Mathematica binary file
  9699. #>71    string \000\010\010\010\010\000\000\000\000\000\000\010\100\010\000\000\000    
  9700. # >71... is optional
  9701. >88    string    >\0    from %s
  9702.  
  9703.  
  9704. # Mathematica files PBF:
  9705. # 115 115 101 120 102 106 000 001 000 000 000 203 000 001 000
  9706. 0    string    MMAPBF\000\001\000\000\000\203\000\001\000    Mathematica PBF (fonts I think)
  9707.  
  9708. # .ml files  These are menu resources I think
  9709. # these start with "[0-9][0-9][0-9]\ A~[0-9][0-9][0-9]\ 
  9710. # how to put that into a magic rule?
  9711. 4    string    \ A~    MAthematica .ml file
  9712.  
  9713. # .nb files
  9714. #too long 0    string    (***********************************************************************\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Mathematica-Compatible Notebook    Mathematica 3.0 notebook
  9715. 0    string    (***********************    Mathematica 3.0 notebook
  9716.  
  9717. # other (* matches it is a comment start in these langs
  9718. # GRR: Too weak; also matches other languages e.g. ML
  9719. #0    string    (*    Mathematica, or Pascal, Modula-2 or 3 code text
  9720.  
  9721. #########################
  9722. # MatLab v5
  9723. 0       string  MATLAB  Matlab v5 mat-file
  9724. >126    short   0x494d  (big endian)
  9725. >>124   beshort x       version 0x%04x
  9726. >126    short   0x4d49  (little endian)
  9727. >>124   leshort x       version 0x%04x
  9728.  
  9729.  
  9730. #------------------------------------------------------------------------------
  9731. # matroska:  file(1) magic for Matroska files
  9732. #
  9733. # See http://www.matroska.org/
  9734. #
  9735.  
  9736. # EBML id:
  9737. 0        belong        0x1a45dfa3
  9738. # DocType id:
  9739. >5        beshort        0x4282
  9740. # DocType contents:
  9741. >>8        string        matroska    Matroska data
  9742.  
  9743. #------------------------------------------------------------------------------
  9744. # Mavroyanopoulos Nikos <nmav@hellug.gr>
  9745. # mcrypt:   file(1) magic for mcrypt 2.2.x;
  9746. 0    string        \0m\3        mcrypt 2.5 encrypted data,
  9747. >4    string        >\0        algorithm: %s,
  9748. >>&1    leshort        >0        keysize: %d bytes,
  9749. >>>&0    string        >\0        mode: %s,
  9750.  
  9751. 0    string        \0m\2        mcrypt 2.2 encrypted data,
  9752. >3    byte        0        algorithm: blowfish-448,
  9753. >3    byte        1        algorithm: DES,
  9754. >3    byte        2        algorithm: 3DES,
  9755. >3    byte        3        algorithm: 3-WAY,
  9756. >3    byte        4        algorithm: GOST,
  9757. >3    byte        6        algorithm: SAFER-SK64,
  9758. >3    byte        7        algorithm: SAFER-SK128,
  9759. >3    byte        8        algorithm: CAST-128,
  9760. >3    byte        9        algorithm: xTEA,
  9761. >3    byte        10        algorithm: TWOFISH-128,
  9762. >3    byte        11        algorithm: RC2,
  9763. >3    byte        12        algorithm: TWOFISH-192,
  9764. >3    byte        13        algorithm: TWOFISH-256,
  9765. >3    byte        14        algorithm: blowfish-128,
  9766. >3    byte        15        algorithm: blowfish-192,
  9767. >3    byte        16        algorithm: blowfish-256,
  9768. >3    byte        100        algorithm: RC6,
  9769. >3    byte        101        algorithm: IDEA,
  9770. >4    byte        0        mode: CBC,
  9771. >4    byte        1        mode: ECB,
  9772. >4    byte        2        mode: CFB,
  9773. >4    byte        3        mode: OFB,
  9774. >4    byte        4        mode: nOFB,
  9775. >5    byte        0        keymode: 8bit
  9776. >5    byte        1        keymode: 4bit
  9777. >5    byte        2        keymode: SHA-1 hash
  9778. >5    byte        3        keymode: MD5 hash
  9779.  
  9780. #------------------------------------------------------------------------------
  9781. # mercurial:  file(1) magic for Mercurial changeset bundles
  9782. # http://www.selenic.com/mercurial/wiki/
  9783. #
  9784. # Jesse Glick (jesse.glick@sun.com)
  9785. #
  9786.  
  9787. 0    string        HG10        Mercurial changeset bundle
  9788. >4    string        UN        (uncompressed)
  9789. >4    string        GZ        (gzip compressed)
  9790. >4    string        BZ        (bzip2 compressed)
  9791. #------------------------------------------------------------------------------
  9792. # mime:  file(1) magic for MIME encoded files
  9793. #
  9794. 0    string        Content-Type:\ 
  9795. >14    string        >\0        %s
  9796. 0    string        Content-Type:
  9797. >13    string        >\0        %s
  9798.  
  9799. #------------------------------------------------------------------------------
  9800. # mips:  file(1) magic for Silicon Graphics (MIPS, IRIS, IRIX, etc.)
  9801. #                         Dec Ultrix (MIPS)
  9802. # all of SGI's *current* machines and OSes run in big-endian mode on the
  9803. # MIPS machines, as far as I know.
  9804. #
  9805. # XXX - what is the blank "-" line?
  9806. #
  9807. # kbd file definitions
  9808. 0    string    kbd!map        kbd map file
  9809. >8    byte    >0        Ver %d:
  9810. >10    short    >0        with %d table(s)
  9811. 0    belong    0407        old SGI 68020 executable
  9812. 0    belong    0410        old SGI 68020 pure executable
  9813. 0    beshort    0x8765        disk quotas file
  9814. 0    beshort    0x0506        IRIS Showcase file
  9815. >2    byte    0x49        -
  9816. >3    byte    x        - version %ld
  9817. 0    beshort    0x0226        IRIS Showcase template
  9818. >2    byte    0x63        -
  9819. >3    byte    x        - version %ld
  9820. 0    belong    0x5343464d    IRIS Showcase file
  9821. >4    byte    x        - version %ld
  9822. 0    belong    0x5443464d    IRIS Showcase template
  9823. >4    byte    x        - version %ld
  9824. 0    belong    0xdeadbabe    IRIX Parallel Arena
  9825. >8    belong    >0        - version %ld
  9826. #
  9827. 0    beshort    0x0160        MIPSEB ECOFF executable
  9828. >20    beshort    0407        (impure)
  9829. >20    beshort    0410        (swapped)
  9830. >20    beshort    0413        (paged)
  9831. >8    belong    >0        not stripped
  9832. >8    belong    0        stripped
  9833. >22    byte    x        - version %ld
  9834. >23    byte    x        .%ld
  9835. #
  9836. 0    beshort    0x0162        MIPSEL-BE ECOFF executable
  9837. >20    beshort    0407        (impure)
  9838. >20    beshort    0410        (swapped)
  9839. >20    beshort    0413        (paged)
  9840. >8    belong    >0        not stripped
  9841. >8    belong    0        stripped
  9842. >23    byte    x        - version %d
  9843. >22    byte    x        .%ld
  9844. #
  9845. 0    beshort    0x6001        MIPSEB-LE ECOFF executable
  9846. >20    beshort    03401        (impure)
  9847. >20    beshort    04001        (swapped)
  9848. >20    beshort    05401        (paged)
  9849. >8    belong    >0        not stripped
  9850. >8    belong    0        stripped
  9851. >23    byte    x        - version %d
  9852. >22    byte    x        .%ld
  9853. #
  9854. 0    beshort    0x6201        MIPSEL ECOFF executable
  9855. >20    beshort    03401        (impure)
  9856. >20    beshort    04001        (swapped)
  9857. >20    beshort    05401        (paged)
  9858. >8    belong    >0        not stripped
  9859. >8    belong    0        stripped
  9860. >23    byte    x        - version %ld
  9861. >22    byte    x        .%ld
  9862. #
  9863. # MIPS 2 additions
  9864. #
  9865. 0    beshort    0x0163        MIPSEB MIPS-II ECOFF executable
  9866. >20    beshort    0407        (impure)
  9867. >20    beshort    0410        (swapped)
  9868. >20    beshort    0413        (paged)
  9869. >8    belong    >0        not stripped
  9870. >8    belong    0        stripped
  9871. >22    byte    x        - version %ld
  9872. >23    byte    x        .%ld
  9873. #
  9874. 0    beshort    0x0166        MIPSEL-BE MIPS-II ECOFF executable
  9875. >20    beshort    0407        (impure)
  9876. >20    beshort    0410        (swapped)
  9877. >20    beshort    0413        (paged)
  9878. >8    belong    >0        not stripped
  9879. >8    belong    0        stripped
  9880. >22    byte    x        - version %ld
  9881. >23    byte    x        .%ld
  9882. #
  9883. 0    beshort    0x6301        MIPSEB-LE MIPS-II ECOFF executable
  9884. >20    beshort    03401        (impure)
  9885. >20    beshort    04001        (swapped)
  9886. >20    beshort    05401        (paged)
  9887. >8    belong    >0        not stripped
  9888. >8    belong    0        stripped
  9889. >23    byte    x        - version %ld
  9890. >22    byte    x        .%ld
  9891. #
  9892. 0    beshort    0x6601        MIPSEL MIPS-II ECOFF executable
  9893. >20    beshort    03401        (impure)
  9894. >20    beshort    04001        (swapped)
  9895. >20    beshort    05401        (paged)
  9896. >8    belong    >0        not stripped
  9897. >8    belong    0        stripped
  9898. >23    byte    x        - version %ld
  9899. >22    byte    x        .%ld
  9900. #
  9901. # MIPS 3 additions
  9902. #
  9903. 0    beshort    0x0140        MIPSEB MIPS-III ECOFF executable
  9904. >20    beshort    0407        (impure)
  9905. >20    beshort    0410        (swapped)
  9906. >20    beshort    0413        (paged)
  9907. >8    belong    >0        not stripped
  9908. >8    belong    0        stripped
  9909. >22    byte    x        - version %ld
  9910. >23    byte    x        .%ld
  9911. #
  9912. 0    beshort    0x0142        MIPSEL-BE MIPS-III ECOFF executable
  9913. >20    beshort    0407        (impure)
  9914. >20    beshort    0410        (swapped)
  9915. >20    beshort    0413        (paged)
  9916. >8    belong    >0        not stripped
  9917. >8    belong    0        stripped
  9918. >22    byte    x        - version %ld
  9919. >23    byte    x        .%ld
  9920. #
  9921. 0    beshort    0x4001        MIPSEB-LE MIPS-III ECOFF executable
  9922. >20    beshort    03401        (impure)
  9923. >20    beshort    04001        (swapped)
  9924. >20    beshort    05401        (paged)
  9925. >8    belong    >0        not stripped
  9926. >8    belong    0        stripped
  9927. >23    byte    x        - version %ld
  9928. >22    byte    x        .%ld
  9929. #
  9930. 0    beshort    0x4201        MIPSEL MIPS-III ECOFF executable
  9931. >20    beshort    03401        (impure)
  9932. >20    beshort    04001        (swapped)
  9933. >20    beshort    05401        (paged)
  9934. >8    belong    >0        not stripped
  9935. >8    belong    0        stripped
  9936. >23    byte    x        - version %ld
  9937. >22    byte    x        .%ld
  9938. #
  9939. 0    beshort    0x180        MIPSEB Ucode
  9940. 0    beshort    0x182        MIPSEL-BE Ucode
  9941. # 32bit core file
  9942. 0    belong    0xdeadadb0    IRIX core dump
  9943. >4    belong    1        of
  9944. >16    string    >\0        '%s'
  9945. # 64bit core file
  9946. 0    belong    0xdeadad40    IRIX 64-bit core dump
  9947. >4    belong    1        of
  9948. >16    string    >\0        '%s'
  9949. # N32bit core file
  9950. 0       belong    0xbabec0bb    IRIX N32 core dump
  9951. >4      belong    1               of
  9952. >16     string    >\0             '%s'
  9953. # New style crash dump file
  9954. 0    string    \x43\x72\x73\x68\x44\x75\x6d\x70    IRIX vmcore dump of
  9955. >36    string    >\0                    '%s'
  9956. # Trusted IRIX info
  9957. 0    string    SGIAUDIT    SGI Audit file
  9958. >8    byte    x        - version %d
  9959. >9    byte    x        .%ld
  9960. #
  9961. 0    string    WNGZWZSC    Wingz compiled script
  9962. 0    string    WNGZWZSS    Wingz spreadsheet
  9963. 0    string    WNGZWZHP    Wingz help file
  9964. #
  9965. 0    string    #Inventor V    IRIS Inventor 1.0 file
  9966. 0    string    #Inventor V2    Open Inventor 2.0 file
  9967. # GLF is OpenGL stream encoding
  9968. 0    string    glfHeadMagic();        GLF_TEXT
  9969. 4    belong    0x7d000000        GLF_BINARY_LSB_FIRST
  9970. 4    belong    0x0000007d        GLF_BINARY_MSB_FIRST
  9971. # GLS is OpenGL stream encoding; GLS is the successor of GLF
  9972. 0    string    glsBeginGLS(        GLS_TEXT
  9973. 4    belong    0x10000000        GLS_BINARY_LSB_FIRST
  9974. 4    belong    0x00000010        GLS_BINARY_MSB_FIRST
  9975.  
  9976. #------------------------------------------------------------------------------
  9977. # mirage:  file(1) magic for Mirage executables
  9978. #
  9979. # XXX - byte order?
  9980. #
  9981. 0    long    31415        Mirage Assembler m.out executable
  9982. #-----------------------------------------------------------------------------
  9983. # misctools:  file(1) magic for miscellaneous UNIX tools.
  9984. #
  9985. 0    search/1    %%!!            X-Post-It-Note text
  9986. 0    string/c    BEGIN:VCALENDAR        vCalendar calendar file
  9987. 0    string/c    BEGIN:VCARD        vCard visiting card
  9988. !:mime    text/x-vcard
  9989.  
  9990. # From: Alex Beregszaszi <alex@fsn.hu>
  9991. 4    string    gtktalog        GNOME Catalogue (gtktalog)
  9992. >13    string    >\0            version %s
  9993.  
  9994. # Summary: Libtool library file
  9995. # Extension: .la
  9996. # Submitted by: Tomasz Trojanowski <tomek@uninet.com.pl>
  9997. 0    search/80    .la\ -\ a\ libtool\ library\ file    libtool library file
  9998.  
  9999. # Summary: Libtool object file
  10000. # Extension: .lo
  10001. # Submitted by: Abel Cheung <abelcheung@gmail.com>
  10002. 0    search/80    .lo\ -\ a\ libtool\ object\ file    libtool object file
  10003.  
  10004. #------------------------------------------------------------------------------
  10005. # mkid:  file(1) magic for mkid(1) databases
  10006. #
  10007. # ID is the binary tags database produced by mkid(1).
  10008. #
  10009. # XXX - byte order?
  10010. #
  10011. 0    string        \311\304    ID tags data
  10012. >2    short        >0        version %d
  10013.  
  10014. #------------------------------------------------------------------------------
  10015. # mlssa: file(1) magic for MLSSA datafiles
  10016. #
  10017. 0        lelong        0xffffabcd    MLSSA datafile,
  10018. >4        leshort        x        algorithm %d,
  10019. >10        lelong        x        %d samples
  10020.  
  10021. #------------------------------------------------------------------------------
  10022. # mmdf:  file(1) magic for MMDF mail files
  10023. #
  10024. 0    string    \001\001\001\001    MMDF mailbox
  10025. #------------------------------------------------------------------------------
  10026. # modem:  file(1) magic for modem programs
  10027. #
  10028. # From: Florian La Roche <florian@knorke.saar.de>
  10029. 1    string        PC\ Research,\ Inc    Digifax-G3-File
  10030. >29    byte        1            \b, fine resolution
  10031. >29    byte        0            \b, normal resolution
  10032.  
  10033. 0    short        0x0100        raw G3 data, byte-padded
  10034. 0    short        0x1400        raw G3 data
  10035. #
  10036. # Magic data for vgetty voice formats
  10037. # (Martin Seine & Marc Eberhard)
  10038.  
  10039. #
  10040. # raw modem data version 1
  10041. #
  10042. 0    string    RMD1      raw modem data
  10043. >4   string    >\0       (%s /
  10044. >20  short     >0        compression type 0x%04x)
  10045.  
  10046. #
  10047. # portable voice format 1
  10048. #
  10049. 0    string    PVF1\n         portable voice format
  10050. >5   string    >\0       (binary %s)
  10051.  
  10052. #
  10053. # portable voice format 2
  10054. #
  10055. 0    string    PVF2\n         portable voice format
  10056. >5   string >\0          (ascii %s)
  10057.  
  10058.  
  10059. #------------------------------------------------------------------------------
  10060. # motorola:  file(1) magic for Motorola 68K and 88K binaries
  10061. #
  10062. # 68K
  10063. #
  10064. 0    beshort        0520        mc68k COFF
  10065. >18    beshort        ^00000020    object
  10066. >18    beshort        &00000020    executable
  10067. >12    belong        >0        not stripped
  10068. >168    string        .lowmem        Apple toolbox
  10069. >20    beshort        0407        (impure)
  10070. >20    beshort        0410        (pure)
  10071. >20    beshort        0413        (demand paged)
  10072. >20    beshort        0421        (standalone)
  10073. 0    beshort        0521        mc68k executable (shared)
  10074. >12    belong        >0        not stripped
  10075. 0    beshort        0522        mc68k executable (shared demand paged)
  10076. >12    belong        >0        not stripped
  10077. #
  10078. # Motorola/UniSoft 68K Binary Compatibility Standard (BCS)
  10079. #
  10080. 0    beshort        0554        68K BCS executable
  10081. #
  10082. # 88K
  10083. #
  10084. # Motorola/88Open BCS
  10085. #
  10086. 0    beshort        0555        88K BCS executable
  10087. #
  10088. # Motorola S-Records, from Gerd Truschinski <gt@freebsd.first.gmd.de>
  10089. 0   string      S0          Motorola S-Record; binary data in text format
  10090.  
  10091. # ATARI ST relocatable PRG
  10092. #
  10093. # from Oskar Schirmer <schirmer@scara.com> Feb 3, 2001
  10094. # (according to Roland Waldi, Oct 21, 1987)
  10095. # besides the magic 0x601a, the text segment size is checked to be
  10096. # not larger than 1 MB (which is a lot on ST).
  10097. # The additional 0x601b distinction I took from Doug Lee's magic.
  10098. 0    belong&0xFFFFFFF0    0x601A0000    Atari ST M68K contiguous executable
  10099. >2    belong            x        (txt=%ld,
  10100. >6    belong            x        dat=%ld,
  10101. >10    belong            x        bss=%ld,
  10102. >14    belong            x        sym=%ld)
  10103. 0    belong&0xFFFFFFF0    0x601B0000    Atari ST M68K non-contig executable
  10104. >2    belong            x        (txt=%ld,
  10105. >6    belong            x        dat=%ld,
  10106. >10    belong            x        bss=%ld,
  10107. >14    belong            x        sym=%ld)
  10108.  
  10109. # Atari ST/TT... program format (sent by Wolfram Kleff <kleff@cs.uni-bonn.de>)
  10110. 0       beshort         0x601A          Atari 68xxx executable,
  10111. >2      belong          x               text len %lu,
  10112. >6      belong          x               data len %lu,
  10113. >10     belong          x               BSS len %lu,
  10114. >14     belong          x               symboltab len %lu,
  10115. >18     belong          0
  10116. >22     belong          &0x01           fastload flag,
  10117. >22     belong          &0x02           may be loaded to alternate RAM,
  10118. >22     belong          &0x04           malloc may be from alternate RAM,
  10119. >22     belong          x               flags: 0x%lX,
  10120. >26     beshort         0               no relocation tab
  10121. >26     beshort         !0              + relocation tab
  10122. >30     string          SFX             [Self-Extracting LZH SFX archive]
  10123. >38     string          SFX             [Self-Extracting LZH SFX archive]
  10124. >44     string          ZIP!            [Self-Extracting ZIP SFX archive]
  10125.  
  10126. 0       beshort         0x0064          Atari 68xxx CPX file
  10127. >8      beshort         x               (version %04lx)
  10128.  
  10129. #------------------------------------------------------------------------------
  10130. # mozilla:  file(1) magic for Mozilla XUL fastload files 
  10131. # (XUL.mfasl and XPC.mfasl)
  10132. # URL:    http://www.mozilla.org/
  10133. # From:    Josh Triplett <josh@freedesktop.org>
  10134.  
  10135. 0    string    XPCOM\nMozFASL\r\n\x1A        Mozilla XUL fastload data
  10136.  
  10137. #------------------------------------------------------------------------------
  10138. # msdos:  file(1) magic for MS-DOS files
  10139. #
  10140.  
  10141. # .BAT files (Daniel Quinlan, quinlan@yggdrasil.com)
  10142. # updated by Joerg Jenderek
  10143. 0    string    @            
  10144. >1    string/cB    \ echo\ off    MS-DOS batch file text
  10145. !:mime    text/x-msdos-batch
  10146. >1    string/cB    echo\ off    MS-DOS batch file text
  10147. !:mime    text/x-msdos-batch
  10148. >1    string/cB    rem\         MS-DOS batch file text
  10149. !:mime    text/x-msdos-batch
  10150. >1    string/cB    set\         MS-DOS batch file text
  10151. !:mime    text/x-msdos-batch
  10152.  
  10153.  
  10154. # OS/2 batch files are REXX. the second regex is a bit generic, oh well
  10155. # the matched commands seem to be common in REXX and uncommon elsewhere
  10156. 100    search/0xffff   rxfuncadd
  10157. >100    regex/c =^[\ \t]{0,10}call[\ \t]{1,10}rxfunc    OS/2 REXX batch file text
  10158. 100    search/0xffff   say
  10159. >100    regex/c =^[\ \t]{0,10}say\ ['"]            OS/2 REXX batch file text
  10160.  
  10161. 0    leshort        0x14c    MS Windows COFF Intel 80386 object file
  10162. #>4    ledate        x    stamp %s
  10163. 0    leshort        0x166    MS Windows COFF MIPS R4000 object file
  10164. #>4    ledate        x    stamp %s
  10165. 0    leshort        0x184    MS Windows COFF Alpha object file
  10166. #>4    ledate        x    stamp %s
  10167. 0    leshort        0x268    MS Windows COFF Motorola 68000 object file
  10168. #>4    ledate        x    stamp %s
  10169. 0    leshort        0x1f0    MS Windows COFF PowerPC object file
  10170. #>4    ledate        x    stamp %s
  10171. 0    leshort        0x290    MS Windows COFF PA-RISC object file
  10172. #>4    ledate        x    stamp %s
  10173.  
  10174. # XXX - according to Microsoft's spec, at an offset of 0x3c in a
  10175. # PE-format executable is the offset in the file of the PE header;
  10176. # unfortunately, that's a little-endian offset, and there's no way
  10177. # to specify an indirect offset with a specified byte order.
  10178. # So, for now, we assume the standard MS-DOS stub, which puts the
  10179. # PE header at 0x80 = 128.
  10180. #
  10181. # Required OS version and subsystem version were 4.0 on some NT 3.51
  10182. # executables built with Visual C++ 4.0, so it's not clear that
  10183. # they're interesting.    The user version was 0.0, but there's
  10184. # probably some linker directive to set it.  The linker version was
  10185. # 3.0, except for one ".exe" which had it as 4.20 (same damn linker!).
  10186. #
  10187. # many of the compressed formats were extraced from IDARC 1.23 source code
  10188. #
  10189. 0    string    MZ
  10190. !:mime    application/x-dosexec
  10191. >0x18  leshort <0x40 MS-DOS executable
  10192. >0 string MZ\0\0\0\0\0\0\0\0\0\0PE\0\0 \b, PE for MS Windows
  10193. >>&18    leshort&0x2000    >0    (DLL)
  10194. >>&88    leshort        0    (unknown subsystem)
  10195. >>&88    leshort        1    (native)
  10196. >>&88    leshort        2    (GUI)
  10197. >>&88    leshort        3    (console)
  10198. >>&88    leshort        7    (POSIX)
  10199. >>&0    leshort        0x0    unknown processor
  10200. >>&0    leshort        0x14c    Intel 80386
  10201. >>&0    leshort        0x166    MIPS R4000
  10202. >>&0    leshort        0x184    Alpha
  10203. >>&0    leshort        0x268    Motorola 68000
  10204. >>&0    leshort        0x1f0    PowerPC
  10205. >>&0    leshort        0x290    PA-RISC
  10206. >>&18    leshort&0x0100    >0    32-bit
  10207. >>&18    leshort&0x1000    >0    system file
  10208. >>&228    lelong        >0    \b, Mono/.Net assembly
  10209. >>&0xf4 search/0x140 \x0\x40\x1\x0
  10210. >>>(&0.l+(4)) string MSCF \b, WinHKI CAB self-extracting archive
  10211. >30        string    Copyright\ 1989-1990\ PKWARE\ Inc.    Self-extracting PKZIP archive
  10212. !:mime    application/zip
  10213. # Is next line correct? One might expect "Corp." not "Copr." If it is right, add a note to that effect.
  10214. >30        string    PKLITE\ Copr.    Self-extracting PKZIP archive
  10215. !:mime    application/zip
  10216.  
  10217. >0x18  leshort >0x3f
  10218. >>(0x3c.l) string PE\0\0 PE
  10219. >>>(0x3c.l+25) byte        1 \b32 executable
  10220. >>>(0x3c.l+25) byte        2 \b32+ executable
  10221. # hooray, there's a DOS extender using the PE format, with a valid PE
  10222. # executable inside (which just prints a message and exits if run in win)
  10223. >>>(0x3c.l+92)    leshort        <10
  10224. >>>>(8.s*16) string 32STUB for MS-DOS, 32rtm DOS extender
  10225. >>>>(8.s*16) string !32STUB for MS Windows
  10226. >>>>>(0x3c.l+22)    leshort&0x2000    >0    (DLL)
  10227. >>>>>(0x3c.l+92)    leshort        0    (unknown subsystem)
  10228. >>>>>(0x3c.l+92)    leshort        1    (native)
  10229. >>>>>(0x3c.l+92)    leshort        2    (GUI)
  10230. >>>>>(0x3c.l+92)    leshort        3    (console)
  10231. >>>>>(0x3c.l+92)    leshort        7    (POSIX)
  10232. >>>(0x3c.l+92)    leshort        10    (EFI application)
  10233. >>>(0x3c.l+92)    leshort        11    (EFI boot service driver)
  10234. >>>(0x3c.l+92)    leshort        12    (EFI runtime driver)
  10235. >>>(0x3c.l+92)    leshort        13    (XBOX)
  10236. >>>(0x3c.l+4)    leshort        0x0    unknown processor
  10237. >>>(0x3c.l+4)    leshort        0x14c    Intel 80386
  10238. >>>(0x3c.l+4)    leshort        0x166    MIPS R4000
  10239. >>>(0x3c.l+4)    leshort        0x184    Alpha
  10240. >>>(0x3c.l+4)    leshort        0x268    Motorola 68000
  10241. >>>(0x3c.l+4)    leshort        0x1f0    PowerPC
  10242. >>>(0x3c.l+4)    leshort        0x290    PA-RISC
  10243. >>>(0x3c.l+4)    leshort        0x200    Intel Itanium
  10244. >>>(0x3c.l+22)    leshort&0x0100    >0    32-bit
  10245. >>>(0x3c.l+22)    leshort&0x1000    >0    system file
  10246. >>>(0x3c.l+232) lelong    >0    Mono/.Net assembly
  10247.  
  10248. >>>>(0x3c.l+0xf8)    string        UPX0 \b, UPX compressed
  10249. >>>>(0x3c.l+0xf8)    search/0x140    PEC2 \b, PECompact2 compressed
  10250. >>>>(0x3c.l+0xf8)    search/0x140    UPX2
  10251. >>>>>(&0x10.l+(-4))    string        PK\3\4 \b, ZIP self-extracting archive (Info-Zip)
  10252. >>>>(0x3c.l+0xf8)    search/0x140    .idata
  10253. >>>>>(&0xe.l+(-4))    string        PK\3\4 \b, ZIP self-extracting archive (Info-Zip)
  10254. >>>>>(&0xe.l+(-4))    string        ZZ0 \b, ZZip self-extracting archive
  10255. >>>>>(&0xe.l+(-4))    string        ZZ1 \b, ZZip self-extracting archive
  10256. >>>>(0x3c.l+0xf8)    search/0x140    .rsrc
  10257. >>>>>(&0x0f.l+(-4))    string        a\\\4\5 \b, WinHKI self-extracting archive
  10258. >>>>>(&0x0f.l+(-4))    string        Rar! \b, RAR self-extracting archive
  10259. >>>>>(&0x0f.l+(-4))    search/0x3000    MSCF \b, InstallShield self-extracting archive
  10260. >>>>>(&0x0f.l+(-4))    search/32    Nullsoft \b, Nullsoft Installer self-extracting archive
  10261. >>>>(0x3c.l+0xf8)    search/0x140    .data
  10262. >>>>>(&0x0f.l)        string        WEXTRACT \b, MS CAB-Installer self-extracting archive
  10263. >>>>(0x3c.l+0xf8)    search/0x140    .petite\0 \b, Petite compressed
  10264. >>>>>(0x3c.l+0xf7)    byte        x
  10265. >>>>>>(&0x104.l+(-4))    string        =!sfx! \b, ACE self-extracting archive
  10266. >>>>(0x3c.l+0xf8)    search/0x140    .WISE \b, WISE installer self-extracting archive
  10267. >>>>(0x3c.l+0xf8)    search/0x140    .dz\0\0\0 \b, Dzip self-extracting archive
  10268. >>>>(0x3c.l+0xf8)    search/0x140    .reloc
  10269. >>>>>(&0xe.l+(-4))    search/0x180    PK\3\4 \b, ZIP self-extracting archive (WinZip)
  10270.  
  10271. >>>>&(0x3c.l+0xf8)    search/0x100    _winzip_ \b, ZIP self-extracting archive (WinZip)
  10272. >>>>&(0x3c.l+0xf8)    search/0x100    SharedD \b, Microsoft Installer self-extracting archive
  10273. >>>>0x30        string        Inno \b, InnoSetup self-extracting archive
  10274.  
  10275. >>(0x3c.l) string !PE\0\0 MS-DOS executable
  10276.  
  10277. >>(0x3c.l)        string        NE \b, NE
  10278. >>>(0x3c.l+0x36)    byte        0 (unknown OS)
  10279. >>>(0x3c.l+0x36)    byte        1 for OS/2 1.x
  10280. >>>(0x3c.l+0x36)    byte        2 for MS Windows 3.x
  10281. >>>(0x3c.l+0x36)    byte        3 for MS-DOS
  10282. >>>(0x3c.l+0x36)    byte        >3 (unknown OS)
  10283. >>>(0x3c.l+0x36)    byte        0x81 for MS-DOS, Phar Lap DOS extender
  10284. >>>(0x3c.l+0x0c)    leshort&0x8003    0x8002 (DLL)
  10285. >>>(0x3c.l+0x0c)    leshort&0x8003    0x8001 (driver)
  10286. >>>&(&0x24.s-1)        string        ARJSFX \b, ARJ self-extracting archive
  10287. >>>(0x3c.l+0x70)    search/0x80    WinZip(R)\ Self-Extractor \b, ZIP self-extracting archive (WinZip)
  10288.  
  10289. >>(0x3c.l)        string        LX\0\0 \b, LX
  10290. >>>(0x3c.l+0x0a)    leshort        <1 (unknown OS)
  10291. >>>(0x3c.l+0x0a)    leshort        1 for OS/2
  10292. >>>(0x3c.l+0x0a)    leshort        2 for MS Windows
  10293. >>>(0x3c.l+0x0a)    leshort        3 for DOS
  10294. >>>(0x3c.l+0x0a)    leshort        >3 (unknown OS)
  10295. >>>(0x3c.l+0x10)    lelong&0x28000    =0x8000 (DLL)
  10296. >>>(0x3c.l+0x10)    lelong&0x20000    >0 (device driver)
  10297. >>>(0x3c.l+0x10)    lelong&0x300    0x300 (GUI)
  10298. >>>(0x3c.l+0x10)    lelong&0x28300    <0x300 (console)
  10299. >>>(0x3c.l+0x08)    leshort        1 i80286
  10300. >>>(0x3c.l+0x08)    leshort        2 i80386
  10301. >>>(0x3c.l+0x08)    leshort        3 i80486
  10302. >>>(8.s*16)        string        emx \b, emx
  10303. >>>>&1            string        x %s
  10304. >>>&(&0x54.l-3)        string        arjsfx \b, ARJ self-extracting archive
  10305.  
  10306. # MS Windows system file, supposedly a collection of LE executables
  10307. >>(0x3c.l)        string        W3 \b, W3 for MS Windows
  10308.  
  10309. >>(0x3c.l)        string        LE\0\0 \b, LE executable
  10310. >>>(0x3c.l+0x0a)    leshort        1
  10311. # some DOS extenders use LE files with OS/2 header
  10312. >>>>0x240        search/0x100    DOS/4G for MS-DOS, DOS4GW DOS extender
  10313. >>>>0x240        search/0x200    WATCOM\ C/C++ for MS-DOS, DOS4GW DOS extender
  10314. >>>>0x440        search/0x100    CauseWay\ DOS\ Extender for MS-DOS, CauseWay DOS extender
  10315. >>>>0x40        search/0x40    PMODE/W for MS-DOS, PMODE/W DOS extender
  10316. >>>>0x40        search/0x40    STUB/32A for MS-DOS, DOS/32A DOS extender (stub)
  10317. >>>>0x40        search/0x80    STUB/32C for MS-DOS, DOS/32A DOS extender (configurable stub)
  10318. >>>>0x40        search/0x80    DOS/32A for MS-DOS, DOS/32A DOS extender (embedded)
  10319. # this is a wild guess; hopefully it is a specific signature
  10320. >>>>&0x24        lelong        <0x50
  10321. >>>>>(&0x4c.l)        string        \xfc\xb8WATCOM
  10322. >>>>>>&0        search/8    3\xdbf\xb9 \b, 32Lite compressed
  10323. # another wild guess: if real OS/2 LE executables exist, they probably have higher start EIP
  10324. #>>>>(0x3c.l+0x1c)    lelong        >0x10000 for OS/2
  10325. # fails with DOS-Extenders.
  10326. >>>(0x3c.l+0x0a)    leshort        2 for MS Windows
  10327. >>>(0x3c.l+0x0a)    leshort        3 for DOS
  10328. >>>(0x3c.l+0x0a)    leshort        4 for MS Windows (VxD)
  10329. >>>(&0x7c.l+0x26)    string        UPX \b, UPX compressed
  10330. >>>&(&0x54.l-3)        string        UNACE \b, ACE self-extracting archive
  10331.  
  10332. # looks like ASCII, probably some embedded copyright message.
  10333. # and definitely not NE/LE/LX/PE
  10334. >>0x3c        lelong    >0x20000000
  10335. >>>(4.s*512)    leshort !0x014c \b, MZ for MS-DOS
  10336. # header data too small for extended executable
  10337. >2        long    !0
  10338. >>0x18        leshort <0x40
  10339. >>>(4.s*512)    leshort !0x014c
  10340.  
  10341. >>>>&(2.s-514)    string    !LE
  10342. >>>>>&-2    string    !BW \b, MZ for MS-DOS
  10343. >>>>&(2.s-514)    string    LE \b, LE
  10344. >>>>>0x240    search/0x100    DOS/4G for MS-DOS, DOS4GW DOS extender
  10345. # educated guess since indirection is still not capable enough for complex offset
  10346. # calculations (next embedded executable would be at &(&2*512+&0-2)
  10347. # I suspect there are only LE executables in these multi-exe files
  10348. >>>>&(2.s-514)    string    BW
  10349. >>>>>0x240    search/0x100    DOS/4G ,\b LE for MS-DOS, DOS4GW DOS extender (embedded)
  10350. >>>>>0x240    search/0x100    !DOS/4G ,\b BW collection for MS-DOS
  10351.  
  10352. # This sequence skips to the first COFF segment, usually .text
  10353. >(4.s*512)    leshort        0x014c \b, COFF
  10354. >>(8.s*16)    string        go32stub for MS-DOS, DJGPP go32 DOS extender
  10355. >>(8.s*16)    string        emx
  10356. >>>&1        string        x for DOS, Win or OS/2, emx %s
  10357. >>&(&0x42.l-3)    byte        x 
  10358. >>>&0x26    string        UPX \b, UPX compressed
  10359. # and yet another guess: small .text, and after large .data is unusal, could be 32lite
  10360. >>&0x2c        search/0xa0    .text
  10361. >>>&0x0b    lelong        <0x2000
  10362. >>>>&0        lelong        >0x6000 \b, 32lite compressed
  10363.  
  10364. >(8.s*16) string $WdX \b, WDos/X DOS extender
  10365.  
  10366. # .EXE formats (Greg Roelofs, newt@uchicago.edu)
  10367. #
  10368. >0x35    string    \x8e\xc0\xb9\x08\x00\xf3\xa5\x4a\x75\xeb\x8e\xc3\x8e\xd8\x33\xff\xbe\x30\x00\x05 \b, aPack compressed
  10369. >0xe7    string    LH/2\ Self-Extract \b, %s
  10370. >0x1c    string    diet \b, diet compressed
  10371. >0x1c    string    LZ09 \b, LZEXE v0.90 compressed
  10372. >0x1c    string    LZ91 \b, LZEXE v0.91 compressed
  10373. >0x1c    string    tz \b, TinyProg compressed
  10374. >0x1e    string    PKLITE \b, %s compressed
  10375. >0x64    string    W\ Collis\0\0 \b, Compack compressed
  10376. >0x24    string    LHa's\ SFX \b, LHa self-extracting archive
  10377. !:mime    application/x-lha
  10378. >0x24    string    LHA's\ SFX \b, LHa self-extracting archive
  10379. !:mime    application/x-lha
  10380. >0x24    string    \ $ARX \b, ARX self-extracting archive
  10381. >0x24    string    \ $LHarc \b, LHarc self-extracting archive
  10382. >0x20    string    SFX\ by\ LARC \b, LARC self-extracting archive
  10383. >1638    string    -lh5- \b, LHa self-extracting archive v2.13S
  10384. >0x17888 string Rar! \b, RAR self-extracting archive
  10385. >0x40    string aPKG \b, aPackage self-extracting archive
  10386.  
  10387. >32     string AIN
  10388. >>35     string 2        \b, AIN 2.x compressed
  10389. >>35     string <2        \b, AIN 1.x compressed
  10390. >>35     string >2        \b, AIN 1.x compressed
  10391. >28     string UC2X        \b, UCEXE compressed
  10392. >28     string WWP\          \b, WWPACK compressed
  10393.  
  10394. # skip to the end of the exe
  10395. >(4.s*512)    long    x 
  10396. >>&(2.s-517)    byte    x 
  10397. >>>&0    string        PK\3\4 \b, ZIP self-extracting archive
  10398. >>>&0    string        Rar! \b, RAR self-extracting archive
  10399. >>>&0    string        =!\x11 \b, AIN 2.x self-extracting archive
  10400. >>>&0    string        =!\x12 \b, AIN 2.x self-extracting archive
  10401. >>>&0    string        =!\x17 \b, AIN 1.x self-extracting archive
  10402. >>>&0    string        =!\x18 \b, AIN 1.x self-extracting archive
  10403. >>>&7    search/400    **ACE** \b, ACE self-extracting archive
  10404. >>>&0    search/0x480    UC2SFX\ Header \b, UC2 self-extracting archive
  10405.  
  10406. >0x1c    string        RJSX \b, ARJ self-extracting archive
  10407. # winarj stores a message in the stub instead of the sig in the MZ header
  10408. >0x20    search/0xe0    aRJsfX \b, ARJ self-extracting archive
  10409.  
  10410. # a few unknown ZIP sfxes, no idea if they are needed or if they are
  10411. # already captured by the generic patterns above
  10412. >0x7a        string        Windows\ self-extracting\ ZIP    \b, ZIP self-extracting archive
  10413. >(8.s*16)    search/0x20    PKSFX \b, ZIP self-extracting archive (PKZIP)
  10414. # TODO: how to add this? >FileSize-34 string Windows\ Self-Installing\ Executable \b, ZIP self-extracting archive
  10415. #
  10416.  
  10417. # TELVOX Teleinformatica CODEC self-extractor for OS/2:
  10418. >49801    string    \x79\xff\x80\xff\x76\xff    \b, CODEC archive v3.21
  10419. >>49824 leshort        =1            \b, 1 file
  10420. >>49824 leshort        >1            \b, %u files
  10421.  
  10422. # .COM formats (Daniel Quinlan, quinlan@yggdrasil.com)
  10423. # Uncommenting only the first two lines will cover about 2/3 of COM files,
  10424. # but it isn't feasible to match all COM files since there must be at least
  10425. # two dozen different one-byte "magics".
  10426. #0    byte        0xe9        DOS executable (COM)
  10427. #>0x1FE leshort        0xAA55        \b, boot code
  10428. >6    string        SFX\ of\ LHarc    (%s)
  10429. 0    belong    0xffffffff        DOS executable (device driver)
  10430. #CMD640X2.SYS
  10431. >10    string    >\x23            
  10432. >>10    string    !\x2e            
  10433. >>>17    string    <\x5B            
  10434. >>>>10    string    x            \b, name: %.8s
  10435. #UDMA.SYS KEYB.SYS CMD640X2.SYS
  10436. >10    string    <\x41            
  10437. >>12    string    >\x40            
  10438. >>>10    string    !$            
  10439. >>>>12    string    x            \b, name: %.8s
  10440. #BTCDROM.SYS ASPICD.SYS
  10441. >22    string    >\x40            
  10442. >>22    string    <\x5B            
  10443. >>>23    string    <\x5B            
  10444. >>>>22    string    x            \b, name: %.8s
  10445. #ATAPICD.SYS
  10446. >76    string    \0            
  10447. >>77    string    >\x40            
  10448. >>>77    string    <\x5B            
  10449. >>>>77    string    x            \b, name: %.8s
  10450. #0    byte        0x8c        DOS executable (COM)
  10451. # 0xeb conflicts with "sequent" magic
  10452. #0    byte        0xeb        DOS executable (COM)
  10453. #>0x1FE leshort        0xAA55        \b, boot code
  10454. #>85    string        UPX        \b, UPX compressed
  10455. #>4    string        \ $ARX        \b, ARX self-extracting archive
  10456. #>4    string        \ $LHarc    \b, LHarc self-extracting archive
  10457. #>0x20e string        SFX\ by\ LARC    \b, LARC self-extracting archive
  10458. #0    byte        0xb8        COM executable
  10459. # modified by Joerg Jenderek
  10460. >1    lelong        !0x21cd4cff    for DOS
  10461. # http://syslinux.zytor.com/comboot.php
  10462. # (32-bit COMBOOT) programs *.C32 contain 32-bit code and run in flat-memory 32-bit protected mode
  10463. # start with assembler instructions mov eax,21cd4cffh
  10464. >1    lelong        0x21cd4cff    (32-bit COMBOOT)
  10465. 0    string    \x81\xfc        
  10466. >4    string    \x77\x02\xcd\x20\xb9    
  10467. >>36    string    UPX!            FREE-DOS executable (COM), UPX compressed
  10468. 252    string Must\ have\ DOS\ version DR-DOS executable (COM)
  10469. # GRR search is not working
  10470. #2    search/28    \xcd\x21    COM executable for MS-DOS
  10471. #WHICHFAT.cOM
  10472. 2    string    \xcd\x21        COM executable for DOS
  10473. #DELTREE.cOM DELTREE2.cOM
  10474. 4    string    \xcd\x21        COM executable for DOS
  10475. #IFMEMDSK.cOM ASSIGN.cOM COMP.cOM
  10476. 5    string    \xcd\x21        COM executable for DOS
  10477. #DELTMP.COm HASFAT32.cOM
  10478. 7    string    \xcd\x21        
  10479. >0    byte    !0xb8            COM executable for DOS
  10480. #COMP.cOM MORE.COm
  10481. 10    string    \xcd\x21        
  10482. >5    string    !\xcd\x21        COM executable for DOS
  10483. #comecho.com
  10484. 13    string    \xcd\x21        COM executable for DOS
  10485. #HELP.COm EDIT.coM
  10486. 18    string    \xcd\x21        COM executable for MS-DOS
  10487. #NWRPLTRM.COm
  10488. 23    string    \xcd\x21        COM executable for MS-DOS
  10489. #LOADFIX.cOm LOADFIX.cOm
  10490. 30    string    \xcd\x21        COM executable for MS-DOS
  10491. #syslinux.com 3.11
  10492. 70    string    \xcd\x21        COM executable for DOS
  10493. # many compressed/converted COMs start with a copy loop instead of a jump
  10494. 0x6    search/0xa    \xfc\x57\xf3\xa5\xc3    COM executable for MS-DOS
  10495. 0x6    search/0xa    \xfc\x57\xf3\xa4\xc3    COM executable for DOS
  10496. >0x18    search/0x10    \x50\xa4\xff\xd5\x73    \b, aPack compressed
  10497. 0x3c    string        W\ Collis\0\0        COM executable for MS-DOS, Compack compressed
  10498. # FIXME: missing diet .com compression
  10499.  
  10500. # miscellaneous formats
  10501. 0    string        LZ        MS-DOS executable (built-in)
  10502. #0    byte        0xf0        MS-DOS program library data
  10503. #
  10504.  
  10505. # AAF files:
  10506. # <stuartc@rd.bbc.co.uk> Stuart Cunningham
  10507. 0    string    \320\317\021\340\241\261\032\341AAFB\015\000OM\006\016\053\064\001\001\001\377            AAF legacy file using MS Structured Storage
  10508. >30    byte    9        (512B sectors)
  10509. >30    byte    12        (4kB sectors)
  10510. 0    string    \320\317\021\340\241\261\032\341\001\002\001\015\000\002\000\000\006\016\053\064\003\002\001\001            AAF file using MS Structured Storage
  10511. >30    byte    9        (512B sectors)
  10512. >30    byte    12        (4kB sectors)
  10513.  
  10514. # Popular applications
  10515. 2080    string    Microsoft\ Word\ 6.0\ Document    %s
  10516. !:mime    application/msword
  10517. 2080    string    Documento\ Microsoft\ Word\ 6 Spanish Microsoft Word 6 document data
  10518. !:mime    application/msword
  10519. # Pawel Wiecek <coven@i17linuxb.ists.pwr.wroc.pl> (for polish Word)
  10520. 2112    string    MSWordDoc            Microsoft Word document data
  10521. !:mime    application/msword
  10522. #
  10523. 0    belong    0x31be0000            Microsoft Word Document
  10524. !:mime    application/msword
  10525. #
  10526. 0    string    PO^Q`                Microsoft Word 6.0 Document
  10527. !:mime    application/msword
  10528. #
  10529. 0    string    \376\067\0\043            Microsoft Office Document
  10530. !:mime    application/msword
  10531. 0    string    \333\245-\0\0\0            Microsoft Office Document
  10532. !:mime    application/msword
  10533. 512    string        \354\245\301        Microsoft Word Document
  10534. !:mime    application/msword
  10535. #
  10536. 2080    string    Microsoft\ Excel\ 5.0\ Worksheet    %s
  10537. !:mime    application/vnd.ms-excel
  10538.  
  10539. 2080    string    Foglio\ di\ lavoro\ Microsoft\ Exce    %s
  10540. !:mime    application/vnd.ms-excel
  10541. #
  10542. # Pawel Wiecek <coven@i17linuxb.ists.pwr.wroc.pl> (for polish Excel)
  10543. 2114    string    Biff5        Microsoft Excel 5.0 Worksheet
  10544. !:mime    application/vnd.ms-excel
  10545. # Italian MS-Excel
  10546. 2121    string    Biff5        Microsoft Excel 5.0 Worksheet
  10547. !:mime    application/vnd.ms-excel
  10548. 0    string    \x09\x04\x06\x00\x00\x00\x10\x00    Microsoft Excel Worksheet
  10549. !:mime    application/vnd.ms-excel
  10550. #
  10551. 0    belong    0x00001a00    Lotus 1-2-3
  10552. !:mime    application/x-123
  10553. >4    belong    0x00100400    wk3 document data
  10554. >4    belong    0x02100400    wk4 document data
  10555. >4    belong    0x07800100    fm3 or fmb document data
  10556. >4    belong    0x07800000    fm3 or fmb document data
  10557. #
  10558. 0    belong    0x00000200    Lotus 1-2-3
  10559. !:mime    application/x-123
  10560. >4    belong    0x06040600    wk1 document data
  10561. >4    belong    0x06800200    fmt document data
  10562. 0    string        WordPro\0    Lotus WordPro
  10563. !:mime    application/vnd.lotus-wordpro
  10564. 0    string        WordPro\r\373    Lotus WordPro
  10565. !:mime    application/vnd.lotus-wordpro
  10566.  
  10567.  
  10568. # Summary: Script used by InstallScield to uninstall applications
  10569. # Extension: .isu
  10570. # Submitted by: unknown
  10571. # Modified by (1): Abel Cheung <abelcheung@gmail.com> (replace useless entry)
  10572. 0        string        \x71\xa8\x00\x00\x01\x02
  10573. >12        string        Stirling\ Technologies,        InstallShield Uninstall Script
  10574.  
  10575. # Winamp .avs
  10576. #0    string    Nullsoft\ AVS\ Preset\ \060\056\061\032 A plug in for Winamp ms-windows Freeware media player
  10577. 0    string    Nullsoft\ AVS\ Preset\     Winamp plug in
  10578.  
  10579. # Windows Metafont .WMF
  10580. 0    string    \327\315\306\232    ms-windows metafont .wmf
  10581. 0    string    \002\000\011\000    ms-windows metafont .wmf
  10582. 0    string    \001\000\011\000    ms-windows metafont .wmf
  10583.  
  10584. #tz3 files whatever that is (MS Works files)
  10585. 0    string    \003\001\001\004\070\001\000\000    tz3 ms-works file
  10586. 0    string    \003\002\001\004\070\001\000\000    tz3 ms-works file
  10587. 0    string    \003\003\001\004\070\001\000\000    tz3 ms-works file
  10588.  
  10589. # PGP sig files .sig
  10590. #0 string \211\000\077\003\005\000\063\237\127 065 to  \027\266\151\064\005\045\101\233\021\002 PGP sig
  10591. 0 string \211\000\077\003\005\000\063\237\127\065\027\266\151\064\005\045\101\233\021\002 PGP sig
  10592. 0 string \211\000\077\003\005\000\063\237\127\066\027\266\151\064\005\045\101\233\021\002 PGP sig
  10593. 0 string \211\000\077\003\005\000\063\237\127\067\027\266\151\064\005\045\101\233\021\002 PGP sig
  10594. 0 string \211\000\077\003\005\000\063\237\127\070\027\266\151\064\005\045\101\233\021\002 PGP sig
  10595. 0 string \211\000\077\003\005\000\063\237\127\071\027\266\151\064\005\045\101\233\021\002 PGP sig
  10596. 0 string \211\000\225\003\005\000\062\122\207\304\100\345\042 PGP sig
  10597.  
  10598. # windows zips files .dmf
  10599. 0    string    MDIF\032\000\010\000\000\000\372\046\100\175\001\000\001\036\001\000 MS Windows special zipped file
  10600.  
  10601.  
  10602. #ico files
  10603. 0    string    \102\101\050\000\000\000\056\000\000\000\000\000\000\000    Icon for MS Windows
  10604.  
  10605. # Windows icons (Ian Springer <ips@fpk.hp.com>)
  10606. 0    string    \000\000\001\000    MS Windows icon resource
  10607. !:mime    image/x-ico
  10608. >4    byte    1            - 1 icon
  10609. >4    byte    >1            - %d icons
  10610. >>6    byte    >0            \b, %dx
  10611. >>>7    byte    >0            \b%d
  10612. >>8    byte    0            \b, 256-colors
  10613. >>8    byte    >0            \b, %d-colors
  10614.  
  10615.  
  10616. # .chr files
  10617. 0    string    PK\010\010BGI    Borland font 
  10618. >4    string    >\0    %s
  10619. # then there is a copyright notice
  10620.  
  10621.  
  10622. # .bgi files
  10623. 0    string    pk\010\010BGI    Borland device 
  10624. >4    string    >\0    %s
  10625. # then there is a copyright notice
  10626.  
  10627.  
  10628. # Windows Recycle Bin record file (named INFO2)
  10629. # By Abel Cheung (abelcheung AT gmail dot com)
  10630. # Version 4 always has 280 bytes (0x118) per record, version 5 has 800 bytes
  10631. # Since Vista uses another structure, INFO2 structure probably won't change
  10632. # anymore. Detailed analysis in:
  10633. # http://www.cybersecurityinstitute.biz/downloads/INFO2.pdf
  10634. 0    lelong        0x00000004
  10635. >12    lelong        0x00000118    Windows Recycle Bin INFO2 file (Win98 or below)
  10636.  
  10637. 0    lelong        0x00000005
  10638. >12    lelong        0x00000320    Windows Recycle Bin INFO2 file (Win2k - WinXP)
  10639.  
  10640.  
  10641. ##### put in Either Magic/font or Magic/news
  10642. # Acroread or something     files wrongly identified as G3     .pfm
  10643. # these have the form \000 \001 any? \002 \000 \000
  10644. # or \000 \001 any? \022 \000 \000
  10645. 0    belong&0xffff00ff    0x00010012    PFM data
  10646. >4    string            \000\000
  10647. >6    string            >\060        - %s
  10648.  
  10649. 0    belong&0xffff00ff    0x00010002    PFM data
  10650. >4    string            \000\000
  10651. >6    string            >\060        - %s
  10652. #0    string    \000\001 pfm?
  10653. #>3    string    \022\000\000Copyright\    yes
  10654. #>3    string    \002\000\000Copyright\    yes
  10655. #>3    string    >\0    oops, not a font file. Cancel that.
  10656. #it clashes with ttf files so put it lower down.
  10657.  
  10658. # From Doug Lee via a FreeBSD pr
  10659. 9    string        GERBILDOC    First Choice document
  10660. 9    string        GERBILDB    First Choice database
  10661. 9    string        GERBILCLIP    First Choice database
  10662. 0    string        GERBIL        First Choice device file
  10663. 9    string        RABBITGRAPH    RabbitGraph file
  10664. 0    string        DCU1        Borland Delphi .DCU file
  10665. 0    string        =!<spell>    MKS Spell hash list (old format)
  10666. 0    string        =!<spell2>    MKS Spell hash list
  10667. # Too simple - MPi
  10668. #0    string        AH        Halo(TM) bitmapped font file
  10669. 0    lelong        0x08086b70    TurboC BGI file
  10670. 0    lelong        0x08084b50    TurboC Font file
  10671.  
  10672. # WARNING: below line conflicts with Infocom game data Z-machine 3
  10673. 0    byte        0x03        DBase 3 data file
  10674. >0x04    lelong        0        (no records)
  10675. >0x04    lelong        >0        (%ld records)
  10676. 0    byte        0x83        DBase 3 data file with memo(s)
  10677. >0x04    lelong        0        (no records)
  10678. >0x04    lelong        >0        (%ld records)
  10679. 0    leshort        0x0006        DBase 3 index file
  10680. 0    string        PMCC        Windows 3.x .GRP file
  10681. 1    string        RDC-meg        MegaDots 
  10682. >8    byte        >0x2F        version %c
  10683. >9    byte        >0x2F        \b.%c file
  10684. 0    lelong        0x4C
  10685. >4    lelong        0x00021401    Windows shortcut file
  10686.  
  10687. # DOS EPS Binary File Header
  10688. # From: Ed Sznyter <ews@Black.Market.NET>
  10689. 0    belong        0xC5D0D3C6    DOS EPS Binary File
  10690. >4    long        >0        Postscript starts at byte %d
  10691. >>8    long        >0        length %d
  10692. >>>12    long        >0        Metafile starts at byte %d
  10693. >>>>16    long        >0        length %d
  10694. >>>20    long        >0        TIFF starts at byte %d
  10695. >>>>24    long        >0        length %d
  10696.  
  10697. # TNEF magic From "Joomy" <joomy@se-ed.net> 
  10698. # Microsoft Outlook's Transport Neutral Encapsulation Format (TNEF)
  10699. 0    leshort        0x223e9f78    TNEF
  10700. !:mime    application/vnd.ms-tnef
  10701.  
  10702. # HtmlHelp files (.chm)
  10703. 0    string    ITSF\003\000\000\000\x60\000\000\000\001\000\000\000    MS Windows HtmlHelp Data
  10704.  
  10705. # GFA-BASIC (Wolfram Kleff)
  10706. 2    string        GFA-BASIC3    GFA-BASIC 3 data
  10707.  
  10708. #------------------------------------------------------------------------------
  10709. # From Stuart Caie <kyzer@4u.net> (developer of cabextract)
  10710. # Microsoft Cabinet files
  10711. 0    string        MSCF\0\0\0\0    Microsoft Cabinet archive data
  10712. >8    lelong        x        \b, %u bytes
  10713. >28    leshort        1        \b, 1 file
  10714. >28    leshort        >1        \b, %u files
  10715.  
  10716. # InstallShield Cabinet files
  10717. 0    string        ISc(        InstallShield Cabinet archive data
  10718. >5    byte&0xf0    =0x60        version 6,
  10719. >5    byte&0xf0    !0x60        version 4/5,
  10720. >(12.l+40)    lelong    x        %u files
  10721.  
  10722. # Windows CE package files
  10723. 0    string        MSCE\0\0\0\0    Microsoft WinCE install header
  10724. >20    lelong        0        \b, architecture-independent
  10725. >20    lelong        103        \b, Hitachi SH3
  10726. >20    lelong        104        \b, Hitachi SH4
  10727. >20    lelong        0xA11        \b, StrongARM
  10728. >20    lelong        4000        \b, MIPS R4000
  10729. >20    lelong        10003        \b, Hitachi SH3
  10730. >20    lelong        10004        \b, Hitachi SH3E
  10731. >20    lelong        10005        \b, Hitachi SH4
  10732. >20    lelong        70001        \b, ARM 7TDMI
  10733. >52    leshort        1        \b, 1 file
  10734. >52    leshort        >1        \b, %u files
  10735. >56    leshort        1        \b, 1 registry entry
  10736. >56    leshort        >1        \b, %u registry entries
  10737.  
  10738.  
  10739. # Windows Enhanced Metafile (EMF)
  10740. # See msdn.microsoft.com/archive/en-us/dnargdi/html/msdn_enhmeta.asp 
  10741. # for further information.
  10742. 0    ulelong 1
  10743. >40    string    \ EMF        Windows Enhanced Metafile (EMF) image data
  10744. >>44    ulelong x        version 0x%x
  10745.  
  10746. # From: Alex Beregszaszi <alex@fsn.hu>
  10747. 0    string    COWD        VMWare3
  10748. >4    byte    3        disk image
  10749. >>32    lelong    x        (%d/
  10750. >>36    lelong    x        \b%d/
  10751. >>40    lelong    x        \b%d)
  10752. >4    byte    2        undoable disk image
  10753. >>32    string    >\0        (%s)
  10754.  
  10755. 0    string    VMDK         VMware4 disk image
  10756. 0    string    KDMV         VMware4 disk image
  10757.  
  10758. #--------------------------------------------------------------------
  10759. # Qemu Emulator Images
  10760. # Lines written by Friedrich Schwittay (f.schwittay@yousable.de)
  10761. # Made by reading sources and doing trial and error on existing
  10762. # qcow files
  10763. 0    string    QFI    Qemu Image, Format: Qcow
  10764.  
  10765. # Uncomment the following line to display Magic (only used for debugging
  10766. # this magic number)
  10767. #>0    string    x    , Magic: %s
  10768.  
  10769. # There are currently 2 Versions: "1" and "2"
  10770. # I do not use Version 2 and therefor branch here
  10771. # but can assure: it works (tested on both versions)
  10772. # Also my Qemu 0.9.0 which uses this Version 2 refuses
  10773. # to start in its bios
  10774. >0x04    belong    2    , Version: 2
  10775. >0x04    belong    1    , Version: 1
  10776.  
  10777. # Using the existence of the Backing File Offset to Branch or not
  10778. # to read Backing File Information
  10779. >>0xc     belong     >0     , Backing File( Offset: %lu
  10780. >>>(0xc.L)     string >\0    , Path: %s
  10781.  
  10782. # Didn't get the trick here how qemu stores the "Size" at this Position
  10783. # There is actually something stored but nothing makes sense
  10784. # The header in the sources talks about it
  10785. #>>>16     lelong     x     , Size: %lu
  10786.  
  10787. # Modification time of the Backing File
  10788. # Really useful if you want to know if your backing
  10789. # file is still usable together with this image
  10790. >>>20     bedate x    , Mtime: %s )
  10791.  
  10792. # Don't know how to calculate in Magicfiles
  10793. # Also: this Information is not reliably
  10794. #    stored in image-files
  10795. >>24     lelong     x     , Disk Size could be: %d * 256 bytes
  10796.  
  10797. 0    string    QEVM        QEMU's suspend to disk image
  10798.  
  10799. 0    string    Bochs\ Virtual\ HD\ Image    Bochs disk image,
  10800. >32    string    x                type %s,
  10801. >48    string    x                subtype %s
  10802.  
  10803. 0    lelong    0x02468ace            Bochs Sparse disk image
  10804.  
  10805. # from http://filext.com by Derek M Jones <derek@knosof.co.uk>
  10806. # False positive with PPT (also currently this string is too long)
  10807. #0    string    \xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3E\x00\x03\x00\xFE\xFF\x09\x00\x06    Microsoft Installer
  10808. 0    string    \320\317\021\340\241\261\032\341    Microsoft Office Document
  10809. #>48    byte    0x1B                    Excel Document
  10810. #!:mime application/vnd.ms-excel
  10811. >546    string    bjbj            Microsoft Word Document
  10812. !:mime    application/msword
  10813. >546    string    jbjb            Microsoft Word Document
  10814. !:mime    application/msword
  10815.  
  10816. 0    string    \224\246\056        Microsoft Word Document
  10817. !:mime    application/msword
  10818.  
  10819. 512    string    R\0o\0o\0t\0\ \0E\0n\0t\0r\0y    Microsoft Word Document
  10820. !:mime    application/msword
  10821.  
  10822. # From: "Nelson A. de Oliveira" <naoliv@gmail.com>
  10823. # Magic type for Dell's BIOS .hdr files
  10824. # Dell's .hdr
  10825. 0    string $RBU
  10826. >23    string Dell            %s system BIOS
  10827. >48    string x            version %.3s
  10828.  
  10829. # Type: Microsoft DirectDraw Surface
  10830. # URL:    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/DDSFileReference/ddsfileformat.asp
  10831. # From: Morten Hustveit <morten@debian.org>
  10832. 0    string    DDS\040\174\000\000\000 Microsoft DirectDraw Surface (DDS),
  10833. >16    lelong    >0            %hd x
  10834. >12    lelong    >0            %hd,
  10835. >84    string    x            %.4s
  10836.  
  10837. # Type: Microsoft Document Imaging Format (.mdi)
  10838. # URL:    http://en.wikipedia.org/wiki/Microsoft_Document_Imaging_Format
  10839. # From: Daniele Sempione <scrows@oziosi.org>
  10840. 0    short    0x5045            Microsoft Document Imaging Format
  10841.  
  10842. # MS eBook format (.lit)
  10843. 0    string    ITOLITLS        Microsoft Reader eBook Data
  10844. >8    lelong    x            \b, version %u
  10845. !:mime                    application/x-ms-reader
  10846.  
  10847. #------------------------------------------------------------------------------
  10848. # msvc:  file(1) magic for msvc
  10849. # "H. Nanosecond" <aldomel@ix.netcom.com>
  10850. # Microsoft visual C
  10851. # I have version 1.0
  10852.  
  10853. # .aps
  10854. 0    string    HWB\000\377\001\000\000\000    Microsoft Visual C .APS file
  10855.  
  10856. # .ide
  10857. #too long 0    string    \102\157\162\154\141\156\144\040\103\053\053\040\120\162\157\152\145\143\164\040\106\151\154\145\012\000\032\000\002\000\262\000\272\276\372\316    MSVC .ide
  10858. 0    string    \102\157\162\154\141\156\144\040\103\053\053\040\120\162\157    MSVC .ide
  10859.  
  10860. # .res
  10861. 0    string    \000\000\000\000\040\000\000\000\377    MSVC .res
  10862. 0    string    \377\003\000\377\001\000\020\020\350    MSVC .res
  10863. 0    string    \377\003\000\377\001\000\060\020\350    MSVC .res
  10864.  
  10865. #.lib
  10866. 0    string    \360\015\000\000    Microsoft Visual C library
  10867. 0    string    \360\075\000\000    Microsoft Visual C library
  10868. 0    string    \360\175\000\000    Microsoft Visual C library
  10869.  
  10870. #.pch
  10871. 0    string    DTJPCH0\000\022\103\006\200    Microsoft Visual C .pch
  10872.  
  10873. # .pdb
  10874. # too long 0    string    Microsoft\ C/C++\ program\ database\ 
  10875. 0    string    Microsoft\ C/C++\     MSVC program database
  10876. >18    string    program\ database\     
  10877. >33    string    >\0    ver %s
  10878.  
  10879. #.sbr
  10880. 0    string    \000\002\000\007\000    MSVC .sbr
  10881. >5    string     >\0    %s
  10882.  
  10883. #.bsc
  10884. 0    string    \002\000\002\001    MSVC .bsc
  10885.  
  10886. #.wsp
  10887. 0    string    1.00\ .0000.0000\000\003    MSVC .wsp version 1.0000.0000
  10888. # these seem to start with the version and contain menus
  10889. # ------------------------------------------------------------------------
  10890. # mup: file(1) magic for Mup (Music Publisher) input file.
  10891. #
  10892. # From: Abel Cheung <abel (@) oaka.org>
  10893. #
  10894. # NOTE: This header is mainly proposed in the Arkkra mailing list,
  10895. # and is not a mandatory header because of old mup input file
  10896. # compatibility. Noteedit also use mup format, but is not forcing
  10897. # user to use any header as well.
  10898. #
  10899. 0        search/1    //!Mup        Mup music publication program input text
  10900. >6        string        -Arkkra        (Arkkra)
  10901. >>13        string        -        
  10902. >>>16        string        .        
  10903. >>>>14        string        x        \b, need V%.4s
  10904. >>>15        string        .        
  10905. >>>>14        string        x        \b, need V%.3s
  10906. >6        string        -        
  10907. >>9        string        .        
  10908. >>>7        string        x        \b, need V%.4s
  10909. >>8        string        .        
  10910. >>>7        string        x        \b, need V%.3s
  10911.  
  10912. #-----------------------------------------------------------------------------
  10913. # natinst:  file(1) magic for National Instruments Code Files
  10914.  
  10915. #
  10916. # From <egamez@fcfm.buap.mx> Enrique GĀ·mez-Flores
  10917. # version 1
  10918. # Many formats still missing, we use, for the moment LabVIEW
  10919. # We guess VXI format file. VISA, LabWindowsCVI, BridgeVIEW, etc, are missing
  10920. #
  10921. 0       string          RSRC            National Instruments,
  10922. # Check if it's a LabVIEW File
  10923. >8      string          LV              LabVIEW File,
  10924. # Check wich kind of file is
  10925. >>10    string          SB              Code Resource File, data
  10926. >>10    string          IN              Virtual Instrument Program, data
  10927. >>10    string          AR              VI Library, data
  10928. # This is for Menu Libraries
  10929. >8      string          LMNULBVW        Portable File Names, data
  10930. # This is for General Resources
  10931. >8      string          rsc             Resources File, data
  10932. # This is for VXI Package
  10933. 0       string          VMAP            National Instruments, VXI File, data
  10934.  
  10935. #------------------------------------------------------------------------------
  10936. # ncr:  file(1) magic for NCR Tower objects
  10937. #
  10938. # contributed by
  10939. # Michael R. Wayne  ***  TMC & Associates  ***  INTERNET: wayne@ford-vax.arpa
  10940. # uucp: {philabs | pyramid} !fmsrl7!wayne   OR   wayne@fmsrl7.UUCP
  10941. #
  10942. 0    beshort        000610    Tower/XP rel 2 object
  10943. >12       belong        >0    not stripped
  10944. >20       beshort        0407    executable
  10945. >20       beshort        0410    pure executable
  10946. >22       beshort        >0    - version %ld
  10947. 0    beshort        000615    Tower/XP rel 2 object
  10948. >12       belong        >0    not stripped
  10949. >20       beshort        0407    executable
  10950. >20       beshort        0410    pure executable
  10951. >22       beshort        >0    - version %ld
  10952. 0    beshort        000620    Tower/XP rel 3 object
  10953. >12       belong        >0    not stripped
  10954. >20       beshort        0407    executable
  10955. >20       beshort        0410    pure executable
  10956. >22       beshort        >0    - version %ld
  10957. 0    beshort        000625    Tower/XP rel 3 object
  10958. >12       belong        >0    not stripped
  10959. >20       beshort        0407    executable
  10960. >20       beshort        0410    pure executable
  10961. >22       beshort        >0    - version %ld
  10962. 0    beshort        000630    Tower32/600/400 68020 object
  10963. >12       belong        >0    not stripped
  10964. >20       beshort        0407    executable
  10965. >20       beshort        0410    pure executable
  10966. >22       beshort        >0    - version %ld
  10967. 0    beshort        000640    Tower32/800 68020
  10968. >18       beshort        &020000    w/68881 object
  10969. >18       beshort        &040000    compatible object
  10970. >18       beshort        &060000    object
  10971. >20       beshort        0407    executable
  10972. >20       beshort        0413    pure executable
  10973. >12       belong        >0    not stripped
  10974. >22       beshort        >0    - version %ld
  10975. 0    beshort        000645    Tower32/800 68010
  10976. >18       beshort        &040000    compatible object
  10977. >18       beshort        &060000 object
  10978. >20       beshort        0407    executable
  10979. >20       beshort        0413    pure executable
  10980. >12       belong        >0    not stripped
  10981. >22       beshort        >0    - version %ld
  10982.  
  10983. #------------------------------------------------------------------------------
  10984. # netbsd:  file(1) magic for NetBSD objects
  10985. #
  10986. # All new-style magic numbers are in network byte order.
  10987. #
  10988.  
  10989. 0    lelong            000000407    a.out NetBSD little-endian object file
  10990. >16    lelong            >0        not stripped
  10991. 0    belong            000000407    a.out NetBSD big-endian object file
  10992. >16    belong            >0        not stripped
  10993.  
  10994. 0    belong&0377777777    041400413    a.out NetBSD/i386 demand paged
  10995. >0    byte            &0x80        
  10996. >>20    lelong            <4096        shared library
  10997. >>20    lelong            =4096        dynamically linked executable
  10998. >>20    lelong            >4096        dynamically linked executable
  10999. >0    byte            ^0x80        executable
  11000. >16    lelong            >0        not stripped
  11001. 0    belong&0377777777    041400410    a.out NetBSD/i386 pure
  11002. >0    byte            &0x80        dynamically linked executable
  11003. >0    byte            ^0x80        executable
  11004. >16    lelong            >0        not stripped
  11005. 0    belong&0377777777    041400407    a.out NetBSD/i386
  11006. >0    byte            &0x80        dynamically linked executable
  11007. >0    byte            ^0x80
  11008. >>0    byte            &0x40        position independent
  11009. >>20    lelong            !0        executable
  11010. >>20    lelong            =0        object file
  11011. >16    lelong            >0        not stripped
  11012. 0    belong&0377777777    041400507    a.out NetBSD/i386 core
  11013. >12    string            >\0        from '%s'
  11014. >32    lelong            !0        (signal %d)
  11015.  
  11016. 0    belong&0377777777    041600413    a.out NetBSD/m68k demand paged
  11017. >0    byte            &0x80        
  11018. >>20    belong            <8192        shared library
  11019. >>20    belong            =8192        dynamically linked executable
  11020. >>20    belong            >8192        dynamically linked executable
  11021. >0    byte            ^0x80        executable
  11022. >16    belong            >0        not stripped
  11023. 0    belong&0377777777    041600410    a.out NetBSD/m68k pure
  11024. >0    byte            &0x80        dynamically linked executable
  11025. >0    byte            ^0x80        executable
  11026. >16    belong            >0        not stripped
  11027. 0    belong&0377777777    041600407    a.out NetBSD/m68k
  11028. >0    byte            &0x80        dynamically linked executable
  11029. >0    byte            ^0x80
  11030. >>0    byte            &0x40        position independent
  11031. >>20    belong            !0        executable
  11032. >>20    belong            =0        object file
  11033. >16    belong            >0        not stripped
  11034. 0    belong&0377777777    041600507    a.out NetBSD/m68k core
  11035. >12    string            >\0        from '%s'
  11036. >32    belong            !0        (signal %d)
  11037.  
  11038. 0    belong&0377777777    042000413    a.out NetBSD/m68k4k demand paged
  11039. >0    byte            &0x80        
  11040. >>20    belong            <4096        shared library
  11041. >>20    belong            =4096        dynamically linked executable
  11042. >>20    belong            >4096        dynamically linked executable
  11043. >0    byte            ^0x80        executable
  11044. >16    belong            >0        not stripped
  11045. 0    belong&0377777777    042000410    a.out NetBSD/m68k4k pure
  11046. >0    byte            &0x80        dynamically linked executable
  11047. >0    byte            ^0x80        executable
  11048. >16    belong            >0        not stripped
  11049. 0    belong&0377777777    042000407    a.out NetBSD/m68k4k
  11050. >0    byte            &0x80        dynamically linked executable
  11051. >0    byte            ^0x80
  11052. >>0    byte            &0x40        position independent
  11053. >>20    belong            !0        executable
  11054. >>20    belong            =0        object file
  11055. >16    belong            >0        not stripped
  11056. 0    belong&0377777777    042000507    a.out NetBSD/m68k4k core
  11057. >12    string            >\0        from '%s'
  11058. >32    belong            !0        (signal %d)
  11059.  
  11060. 0    belong&0377777777    042200413    a.out NetBSD/ns32532 demand paged
  11061. >0    byte            &0x80        
  11062. >>20    lelong            <4096        shared library
  11063. >>20    lelong            =4096        dynamically linked executable
  11064. >>20    lelong            >4096        dynamically linked executable
  11065. >0    byte            ^0x80        executable
  11066. >16    lelong            >0        not stripped
  11067. 0    belong&0377777777    042200410    a.out NetBSD/ns32532 pure
  11068. >0    byte            &0x80        dynamically linked executable
  11069. >0    byte            ^0x80        executable
  11070. >16    lelong            >0        not stripped
  11071. 0    belong&0377777777    042200407    a.out NetBSD/ns32532
  11072. >0    byte            &0x80        dynamically linked executable
  11073. >0    byte            ^0x80
  11074. >>0    byte            &0x40        position independent
  11075. >>20    lelong            !0        executable
  11076. >>20    lelong            =0        object file
  11077. >16    lelong            >0        not stripped
  11078. 0    belong&0377777777    042200507    a.out NetBSD/ns32532 core
  11079. >12    string            >\0        from '%s'
  11080. >32    lelong            !0        (signal %d)
  11081.  
  11082. 0    belong&0377777777    045200507    a.out NetBSD/powerpc core
  11083. >12    string            >\0        from '%s'
  11084.  
  11085. 0    belong&0377777777    042400413    a.out NetBSD/sparc demand paged
  11086. >0    byte            &0x80        
  11087. >>20    belong            <8192        shared library
  11088. >>20    belong            =8192        dynamically linked executable
  11089. >>20    belong            >8192        dynamically linked executable
  11090. >0    byte            ^0x80        executable
  11091. >16    belong            >0        not stripped
  11092. 0    belong&0377777777    042400410    a.out NetBSD/sparc pure
  11093. >0    byte            &0x80        dynamically linked executable
  11094. >0    byte            ^0x80        executable
  11095. >16    belong            >0        not stripped
  11096. 0    belong&0377777777    042400407    a.out NetBSD/sparc
  11097. >0    byte            &0x80        dynamically linked executable
  11098. >0    byte            ^0x80
  11099. >>0    byte            &0x40        position independent
  11100. >>20    belong            !0        executable
  11101. >>20    belong            =0        object file
  11102. >16    belong            >0        not stripped
  11103. 0    belong&0377777777    042400507    a.out NetBSD/sparc core
  11104. >12    string            >\0        from '%s'
  11105. >32    belong            !0        (signal %d)
  11106.  
  11107. 0    belong&0377777777    042600413    a.out NetBSD/pmax demand paged
  11108. >0    byte            &0x80        
  11109. >>20    lelong            <4096        shared library
  11110. >>20    lelong            =4096        dynamically linked executable
  11111. >>20    lelong            >4096        dynamically linked executable
  11112. >0    byte            ^0x80        executable
  11113. >16    lelong            >0        not stripped
  11114. 0    belong&0377777777    042600410    a.out NetBSD/pmax pure
  11115. >0    byte            &0x80        dynamically linked executable
  11116. >0    byte            ^0x80        executable
  11117. >16    lelong            >0        not stripped
  11118. 0    belong&0377777777    042600407    a.out NetBSD/pmax
  11119. >0    byte            &0x80        dynamically linked executable
  11120. >0    byte            ^0x80
  11121. >>0    byte            &0x40        position independent
  11122. >>20    lelong            !0        executable
  11123. >>20    lelong            =0        object file
  11124. >16    lelong            >0        not stripped
  11125. 0    belong&0377777777    042600507    a.out NetBSD/pmax core
  11126. >12    string            >\0        from '%s'
  11127. >32    lelong            !0        (signal %d)
  11128.  
  11129. 0    belong&0377777777    043000413    a.out NetBSD/vax 1k demand paged
  11130. >0    byte            &0x80        
  11131. >>20    lelong            <4096        shared library
  11132. >>20    lelong            =4096        dynamically linked executable
  11133. >>20    lelong            >4096        dynamically linked executable
  11134. >0    byte            ^0x80        executable
  11135. >16    lelong            >0        not stripped
  11136. 0    belong&0377777777    043000410    a.out NetBSD/vax 1k pure
  11137. >0    byte            &0x80        dynamically linked executable
  11138. >0    byte            ^0x80        executable
  11139. >16    lelong            >0        not stripped
  11140. 0    belong&0377777777    043000407    a.out NetBSD/vax 1k
  11141. >0    byte            &0x80        dynamically linked executable
  11142. >0    byte            ^0x80
  11143. >>0    byte            &0x40        position independent
  11144. >>20    lelong            !0        executable
  11145. >>20    lelong            =0        object file
  11146. >16    lelong            >0        not stripped
  11147. 0    belong&0377777777    043000507    a.out NetBSD/vax 1k core
  11148. >12    string            >\0        from '%s'
  11149. >32    lelong            !0        (signal %d)
  11150.  
  11151. 0    belong&0377777777    045400413    a.out NetBSD/vax 4k demand paged
  11152. >0    byte            &0x80        
  11153. >>20    lelong            <4096        shared library
  11154. >>20    lelong            =4096        dynamically linked executable
  11155. >>20    lelong            >4096        dynamically linked executable
  11156. >0    byte            ^0x80        executable
  11157. >16    lelong            >0        not stripped
  11158. 0    belong&0377777777    045400410    a.out NetBSD/vax 4k pure
  11159. >0    byte            &0x80        dynamically linked executable
  11160. >0    byte            ^0x80        executable
  11161. >16    lelong            >0        not stripped
  11162. 0    belong&0377777777    045400407    a.out NetBSD/vax 4k
  11163. >0    byte            &0x80        dynamically linked executable
  11164. >0    byte            ^0x80
  11165. >>0    byte            &0x40        position independent
  11166. >>20    lelong            !0        executable
  11167. >>20    lelong            =0        object file
  11168. >16    lelong            >0        not stripped
  11169. 0    belong&0377777777    045400507    a.out NetBSD/vax 4k core
  11170. >12    string            >\0        from '%s'
  11171. >32    lelong            !0        (signal %d)
  11172.  
  11173. # NetBSD/alpha does not support (and has never supported) a.out objects,
  11174. # so no rules are provided for them.  NetBSD/alpha ELF objects are 
  11175. # dealt with in "elf".
  11176. 0    lelong        0x00070185        ECOFF NetBSD/alpha binary
  11177. >10    leshort        0x0001            not stripped
  11178. >10    leshort        0x0000            stripped
  11179. 0    belong&0377777777    043200507    a.out NetBSD/alpha core
  11180. >12    string            >\0        from '%s'
  11181. >32    lelong            !0        (signal %d)
  11182.  
  11183. 0    belong&0377777777    043400413    a.out NetBSD/mips demand paged
  11184. >0    byte            &0x80        
  11185. >>20    belong            <8192        shared library
  11186. >>20    belong            =8192        dynamically linked executable
  11187. >>20    belong            >8192        dynamically linked executable
  11188. >0    byte            ^0x80        executable
  11189. >16    belong            >0        not stripped
  11190. 0    belong&0377777777    043400410    a.out NetBSD/mips pure
  11191. >0    byte            &0x80        dynamically linked executable
  11192. >0    byte            ^0x80        executable
  11193. >16    belong            >0        not stripped
  11194. 0    belong&0377777777    043400407    a.out NetBSD/mips
  11195. >0    byte            &0x80        dynamically linked executable
  11196. >0    byte            ^0x80
  11197. >>0    byte            &0x40        position independent
  11198. >>20    belong            !0        executable
  11199. >>20    belong            =0        object file
  11200. >16    belong            >0        not stripped
  11201. 0    belong&0377777777    043400507    a.out NetBSD/mips core
  11202. >12    string            >\0        from '%s'
  11203. >32    belong            !0        (signal %d)
  11204.  
  11205. 0    belong&0377777777    043600413    a.out NetBSD/arm32 demand paged
  11206. >0    byte            &0x80
  11207. >>20    lelong            <4096        shared library
  11208. >>20    lelong            =4096        dynamically linked executable
  11209. >>20    lelong            >4096        dynamically linked executable
  11210. >0    byte            ^0x80        executable
  11211. >16    lelong            >0        not stripped
  11212. 0    belong&0377777777    043600410    a.out NetBSD/arm32 pure
  11213. >0    byte            &0x80        dynamically linked executable
  11214. >0    byte            ^0x80        executable
  11215. >16    lelong            >0        not stripped
  11216. 0    belong&0377777777    043600407    a.out NetBSD/arm32
  11217. >0    byte            &0x80        dynamically linked executable
  11218. >0    byte            ^0x80
  11219. >>0    byte            &0x40        position independent
  11220. >>20    lelong            !0        executable
  11221. >>20    lelong            =0        object file
  11222. >16    lelong            >0        not stripped
  11223. # NetBSD/arm26 has always used ELF objects, but it shares a core file
  11224. # format with NetBSD/arm32.
  11225. 0    belong&0377777777    043600507    a.out NetBSD/arm core
  11226. >12    string            >\0        from '%s'
  11227. >32    lelong            !0        (signal %d)
  11228.  
  11229. #------------------------------------------------------------------------------
  11230. # netscape:  file(1) magic for Netscape files
  11231. # "H. Nanosecond" <aldomel@ix.netcom.com>
  11232. # version 3 and 4 I think
  11233. #
  11234.  
  11235. # Netscape Address book  .nab
  11236. 0    string \000\017\102\104\000\000\000\000\000\000\001\000\000\000\000\002\000\000\000\002\000\000\004\000 Netscape Address book
  11237.  
  11238. # Netscape Communicator address book
  11239. 0   string   \000\017\102\111 Netscape Communicator address book
  11240.  
  11241. # .snm Caches
  11242. 0    string        #\ Netscape\ folder\ cache    Netscape folder cache
  11243. 0    string    \000\036\204\220\000    Netscape folder cache
  11244. # .n2p 
  11245. # Net 2 Phone 
  11246. #0    string    123\130\071\066\061\071\071\071\060\070\061\060\061\063\060
  11247. 0    string    SX961999    Net2phone
  11248.  
  11249. #
  11250. #This is files ending in .art, FIXME add more rules
  11251. 0       string          JG\004\016\0\0\0\0      ART
  11252.  
  11253. #------------------------------------------------------------------------------
  11254. # netware:  file(1) magic for NetWare Loadable Modules (NLMs)
  11255. # From: Mads Martin Joergensen <mmj@suse.de>
  11256.  
  11257. 0    string    NetWare\ Loadable\ Module    NetWare Loadable Module
  11258.  
  11259. #------------------------------------------------------------------------------
  11260. # news:  file(1) magic for SunOS NeWS fonts (not "news" as in "netnews")
  11261. #
  11262. 0    string        StartFontMetrics    ASCII font metrics
  11263. 0    string        StartFont    ASCII font bits
  11264. 0    belong        0x137A2944    NeWS bitmap font
  11265. 0    belong        0x137A2947    NeWS font family
  11266. 0    belong        0x137A2950    scalable OpenFont binary
  11267. 0    belong        0x137A2951    encrypted scalable OpenFont binary
  11268. 8    belong        0x137A2B45    X11/NeWS bitmap font
  11269. 8    belong        0x137A2B48    X11/NeWS font family
  11270. #------------------------------------------------------------------------------
  11271. # nitpicker:  file(1) magic for Flowfiles.
  11272. # From: Christian Jachmann <C.Jachmann@gmx.net> http://www.nitpicker.de
  11273. 0    string    NPFF    NItpicker Flow File 
  11274. >4    byte    x    V%d.
  11275. >5    byte    x    %d
  11276. >6    bedate    x    started: %s
  11277. >10    bedate    x    stopped: %s
  11278. >14    belong    x    Bytes: %u
  11279. >18    belong    x    Bytes1: %u
  11280. >22    belong    x    Flows: %u
  11281. >26    belong    x    Pkts: %u
  11282.  
  11283. #------------------------------------------------------------------------------
  11284. # ocaml: file(1) magic for Objective Caml files.
  11285. 0    string    Caml1999    OCaml
  11286. >8    string    X        exec file
  11287. >8    string    I        interface file (.cmi)
  11288. >8    string    O        object file (.cmo)
  11289. >8    string    A        library file (.cma)
  11290. >8    string    Y        native object file (.cmx)
  11291. >8    string    Z        native library file (.cmxa)
  11292. >8    string    M        abstract syntax tree implementation file
  11293. >8    string    N        abstract syntax tree interface file
  11294. >9    string    >\0        (Version %3.3s)
  11295. #------------------------------------------------------------------------------
  11296. # octave binary data file(1) magic, from Dirk Eddelbuettel <edd@debian.org>
  11297. 0    string        Octave-1-L    Octave binary data (little endian)
  11298. 0    string        Octave-1-B    Octave binary data (big endian)
  11299.  
  11300. #------------------------------------------------------------------------------
  11301. # Microsoft OLE 2 Compound Documents : file(1) magic for Microsoft Structured
  11302. # storage (http://en.wikipedia.org/wiki/Structured_Storage)
  11303. # Additional tests for OLE 2 Compound Documents should be under this recipe.
  11304.  
  11305. 0   string  \320\317\021\340\241\261\032\341      OLE 2 Compound Document
  11306. # - Microstation V8 DGN files (www.bentley.com)
  11307. #   Last update on 10/23/2006 by Lester Hightower
  11308. > 0x480  string  D\000g\000n\000~\000H                : Microstation V8 DGN
  11309. # - Visio documents
  11310. #   Last update on 10/23/2006 by Lester Hightower
  11311. > 0x480  string  V\000i\000s\000i\000o\000D\000o\000c : Visio Document
  11312.  
  11313. #------------------------------------------------------------------------------
  11314. # olf:  file(1) magic for OLF executables
  11315. #
  11316. # We have to check the byte order flag to see what byte order all the
  11317. # other stuff in the header is in.
  11318. #
  11319. # MIPS R3000 may also be for MIPS R2000.
  11320. # What're the correct byte orders for the nCUBE and the Fujitsu VPP500?
  11321. #
  11322. # Created by Erik Theisen <etheisen@openbsd.org>
  11323. # Based on elf from Daniel Quinlan <quinlan@yggdrasil.com>
  11324. 0    string        \177OLF        OLF
  11325. >4    byte        0        invalid class
  11326. >4    byte        1        32-bit
  11327. >4    byte        2        64-bit
  11328. >7    byte        0        invalid os
  11329. >7    byte        1        OpenBSD
  11330. >7    byte        2        NetBSD
  11331. >7    byte        3        FreeBSD
  11332. >7    byte        4        4.4BSD
  11333. >7    byte        5        Linux
  11334. >7    byte        6        SVR4
  11335. >7    byte        7        esix
  11336. >7    byte        8        Solaris
  11337. >7    byte        9        Irix
  11338. >7    byte        10        SCO
  11339. >7    byte        11        Dell
  11340. >7    byte        12        NCR
  11341. >5    byte        0        invalid byte order
  11342. >5    byte        1        LSB
  11343. >>16    leshort        0        no file type,
  11344. >>16    leshort        1        relocatable,
  11345. >>16    leshort        2        executable,
  11346. >>16    leshort        3        shared object,
  11347. # Core handling from Peter Tobias <tobias@server.et-inf.fho-emden.de>
  11348. # corrections by Christian 'Dr. Disk' Hechelmann <drdisk@ds9.au.s.shuttle.de>
  11349. >>16    leshort        4        core file
  11350. >>>(0x38+0xcc) string    >\0        of '%s'
  11351. >>>(0x38+0x10) lelong    >0        (signal %d),
  11352. >>16    leshort        &0xff00        processor-specific,
  11353. >>18    leshort        0        no machine,
  11354. >>18    leshort        1        AT&T WE32100 - invalid byte order,
  11355. >>18    leshort        2        SPARC - invalid byte order,
  11356. >>18    leshort        3        Intel 80386,
  11357. >>18    leshort        4        Motorola 68000 - invalid byte order,
  11358. >>18    leshort        5        Motorola 88000 - invalid byte order,
  11359. >>18    leshort        6        Intel 80486,
  11360. >>18    leshort        7        Intel 80860,
  11361. >>18    leshort        8        MIPS R3000_BE - invalid byte order,
  11362. >>18    leshort        9        Amdahl - invalid byte order,
  11363. >>18    leshort        10        MIPS R3000_LE,
  11364. >>18    leshort        11        RS6000 - invalid byte order,
  11365. >>18    leshort        15        PA-RISC - invalid byte order,
  11366. >>18    leshort        16        nCUBE,
  11367. >>18    leshort        17        VPP500,
  11368. >>18    leshort        18        SPARC32PLUS,
  11369. >>18    leshort        20        PowerPC,
  11370. >>18    leshort        0x9026        Alpha,
  11371. >>20    lelong        0        invalid version
  11372. >>20    lelong        1        version 1
  11373. >>36    lelong        1        MathCoPro/FPU/MAU Required
  11374. >8    string        >\0        (%s)
  11375. >5    byte        2        MSB
  11376. >>16    beshort        0        no file type,
  11377. >>16    beshort        1        relocatable,
  11378. >>16    beshort        2        executable,
  11379. >>16    beshort        3        shared object,
  11380. >>16    beshort        4        core file,
  11381. >>>(0x38+0xcc) string    >\0        of '%s'
  11382. >>>(0x38+0x10) belong    >0        (signal %d),
  11383. >>16    beshort        &0xff00        processor-specific,
  11384. >>18    beshort        0        no machine,
  11385. >>18    beshort        1        AT&T WE32100,
  11386. >>18    beshort        2        SPARC,
  11387. >>18    beshort        3        Intel 80386 - invalid byte order,
  11388. >>18    beshort        4        Motorola 68000,
  11389. >>18    beshort        5        Motorola 88000,
  11390. >>18    beshort        6        Intel 80486 - invalid byte order,
  11391. >>18    beshort        7        Intel 80860,
  11392. >>18    beshort        8        MIPS R3000_BE,
  11393. >>18    beshort        9        Amdahl,
  11394. >>18    beshort        10        MIPS R3000_LE - invalid byte order,
  11395. >>18    beshort        11        RS6000,
  11396. >>18    beshort        15        PA-RISC,
  11397. >>18    beshort        16        nCUBE,
  11398. >>18    beshort        17        VPP500,
  11399. >>18    beshort        18        SPARC32PLUS,
  11400. >>18    beshort        20        PowerPC or cisco 4500,
  11401. >>18    beshort        21        cisco 7500,
  11402. >>18    beshort        24        cisco SVIP,
  11403. >>18    beshort        25        cisco 7200,
  11404. >>18    beshort        36        cisco 12000,
  11405. >>18    beshort        0x9026        Alpha,
  11406. >>20    belong        0        invalid version
  11407. >>20    belong        1        version 1
  11408. >>36    belong        1        MathCoPro/FPU/MAU Required
  11409. #------------------------------------------------------------------------------
  11410. # os2:  file(1) magic for OS/2 files
  11411. #
  11412.  
  11413. # Provided 1998/08/22 by
  11414. # David Mediavilla <davidme.news@REMOVEIFNOTSPAMusa.net>
  11415. 1    search/1    InternetShortcut    MS Windows 95 Internet shortcut text
  11416. >24    search/1    >\             (URL=<%s>)
  11417.  
  11418. # OS/2 URL objects
  11419. # Provided 1998/08/22 by
  11420. # David Mediavilla <davidme.news@REMOVEIFNOTSPAMusa.net>
  11421. #0    string    http:            OS/2 URL object text
  11422. #>5    string    >\            (WWW) <http:%s>
  11423. #0    string    mailto:            OS/2 URL object text
  11424. #>7    string    >\            (email) <%s>
  11425. #0    string    news:            OS/2 URL object text
  11426. #>5    string    >\            (Usenet) <%s>
  11427. #0    string    ftp:            OS/2 URL object text
  11428. #>4    string    >\            (FTP) <ftp:%s>
  11429. #0    string    file:            OS/2 URL object text
  11430. #>5    string    >\            (Local file) <%s>
  11431.  
  11432. # >>>>> OS/2 INF/HLP <<<<<  (source: Daniel Dissett ddissett@netcom.com)
  11433. # Carl Hauser (chauser.parc@xerox.com) and 
  11434. # Marcus Groeber (marcusg@ph-cip.uni-koeln.de)
  11435. # list the following header format in inf02a.doc:
  11436. #
  11437. #  int16 ID;           // ID magic word (5348h = "HS")
  11438. #  int8  unknown1;     // unknown purpose, could be third letter of ID
  11439. #  int8  flags;        // probably a flag word...
  11440. #                      //  bit 0: set if INF style file
  11441. #                      //  bit 4: set if HLP style file
  11442. #                      // patching this byte allows reading HLP files
  11443. #                      // using the VIEW command, while help files 
  11444. #                      // seem to work with INF settings here as well.
  11445. #  int16 hdrsize;      // total size of header
  11446. #  int16 unknown2;     // unknown purpose
  11447. 0   string  HSP\x01\x9b\x00 OS/2 INF
  11448. >107 string >0                      (%s)
  11449. 0   string  HSP\x10\x9b\x00     OS/2 HLP
  11450. >107 string >0                      (%s)
  11451.  
  11452. # OS/2 INI (this is a guess)
  11453. 0  string   \xff\xff\xff\xff\x14\0\0\0  OS/2 INI
  11454. #------------------------------------------------------------------------------
  11455. # os400:  file(1) magic for IBM OS/400 files
  11456. #
  11457. # IBM OS/400 (i5/OS) Save file (SAVF) - gerardo.cacciari@gmail.com
  11458. # In spite of its quite variable format (due to internal memory page
  11459. # length differences between CISC and RISC versions of the OS) the
  11460. # SAVF structure hasn't suitable offsets to identify the catalog
  11461. # header in the first descriptor where there are some useful infos,
  11462. # so we must search in a somewhat large area for a particular string
  11463. # that represents the EBCDIC encoding of 'QSRDSSPC' (save/restore
  11464. # descriptor space) preceded by a two byte constant.
  11465. #
  11466. 1090     search/7393    \x19\xDB\xD8\xE2\xD9\xC4\xE2\xE2\xD7\xC3 IBM OS/400 save file data
  11467. >&212     byte        0x01             \b, created with SAVOBJ
  11468. >&212     byte        0x02             \b, created with SAVLIB
  11469. >&212     byte        0x07             \b, created with SAVCFG
  11470. >&212     byte        0x08             \b, created with SAVSECDTA
  11471. >&212     byte        0x0A             \b, created with SAVSECDTA
  11472. >&212     byte        0x0B             \b, created with SAVDLO
  11473. >&212     byte        0x0D             \b, created with SAVLICPGM
  11474. >&212     byte        0x11             \b, created with SAVCHGOBJ
  11475. >&213     byte        0x44             \b, at least V5R4 to open
  11476. >&213     byte        0x43             \b, at least V5R3 to open
  11477. >&213     byte        0x42             \b, at least V5R2 to open
  11478. >&213     byte        0x41             \b, at least V5R1 to open
  11479. >&213     byte        0x40             \b, at least V4R5 to open
  11480. >&213     byte        0x3F             \b, at least V4R4 to open
  11481. >&213     byte        0x3E             \b, at least V4R3 to open
  11482. >&213     byte        0x3C             \b, at least V4R2 to open
  11483. >&213     byte        0x3D             \b, at least V4R1M4 to open
  11484. >&213     byte        0x3B             \b, at least V4R1 to open
  11485. >&213     byte        0x3A             \b, at least V3R7 to open
  11486. >&213     byte        0x35             \b, at least V3R6 to open
  11487. >&213     byte        0x36             \b, at least V3R2 to open
  11488. >&213     byte        0x34             \b, at least V3R1 to open
  11489. >&213     byte        0x31             \b, at least V3R0M5 to open
  11490. >&213     byte        0x30             \b, at least V2R3 to open
  11491. #
  11492. # Copyright (c) 1996 Ignatios Souvatzis. All rights reserved.
  11493. #
  11494. # Redistribution and use in source and binary forms, with or without
  11495. # modification, are permitted provided that the following conditions
  11496. # are met:
  11497. # 1. Redistributions of source code must retain the above copyright
  11498. #    notice, this list of conditions and the following disclaimer.
  11499. # 2. Redistributions in binary form must reproduce the above copyright
  11500. #    notice, this list of conditions and the following disclaimer in the
  11501. #    documentation and/or other materials provided with the distribution.
  11502. # 3. All advertising materials mentioning features or use of this software
  11503. #    must display the following acknowledgement:
  11504. #      This product includes software developed by Ignatios Souvatzis for
  11505. #      the NetBSD project.
  11506. # 4. The name of the author may not be used to endorse or promote products
  11507. #    derived from this software without specific prior written permission.
  11508. #
  11509. #
  11510. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  11511. # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  11512. # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  
  11513. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  11514. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  11515. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  11516. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  11517. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  11518. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  11519. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  11520. #
  11521. #
  11522. #
  11523. # OS9/6809 module descriptions:
  11524. #
  11525. 0    beshort        0x87CD    OS9/6809 module:
  11526. #
  11527. >6    byte&0x0f    0x00    non-executable
  11528. >6    byte&0x0f    0x01    machine language
  11529. >6    byte&0x0f    0x02    BASIC I-code
  11530. >6    byte&0x0f    0x03    Pascal P-code
  11531. >6    byte&0x0f    0x04    C I-code
  11532. >6    byte&0x0f    0x05    COBOL I-code
  11533. >6    byte&0x0f    0x06    Fortran I-code
  11534. #
  11535. >6    byte&0xf0    0x10    program executable
  11536. >6    byte&0xf0    0x20    subroutine
  11537. >6    byte&0xf0    0x30    multi-module
  11538. >6    byte&0xf0    0x40    data module
  11539. #
  11540. >6    byte&0xf0    0xC0    system module
  11541. >6    byte&0xf0    0xD0    file manager
  11542. >6    byte&0xf0    0xE0    device driver
  11543. >6    byte&0xf0    0xF0    device descriptor
  11544. #
  11545. # OS9/m68k stuff (to be continued)
  11546. #
  11547. 0    beshort        0x4AFC    OS9/68K module:
  11548. #
  11549. # attr
  11550. >0x14    byte&0x80    0x80    re-entrant
  11551. >0x14    byte&0x40    0x40    ghost
  11552. >0x14    byte&0x20    0x20    system-state
  11553. #
  11554. # lang:
  11555. #
  11556. >0x13    byte        1    machine language
  11557. >0x13    byte        2    BASIC I-code
  11558. >0x13    byte        3    Pascal P-code
  11559. >0x13    byte        4    C I-code
  11560. >0x13    byte        5    COBOL I-code
  11561. >0x13    byte        6    Fortran I-code
  11562. #
  11563. #
  11564. # type:
  11565. #
  11566. >0x12    byte        1    program executable
  11567. >0x12    byte        2    subroutine
  11568. >0x12    byte        3    multi-module
  11569. >0x12    byte        4    data module
  11570. >0x12    byte        11    trap library
  11571. >0x12    byte        12    system module
  11572. >0x12    byte        13    file manager
  11573. >0x12    byte        14    device driver
  11574. >0x12    byte        15    device descriptor
  11575. #
  11576. # Mach magic number info
  11577. #
  11578. 0    long        0xefbe    OSF/Rose object
  11579. # I386 magic number info
  11580. #
  11581. 0    short        0565    i386 COFF object
  11582.  
  11583. #------------------------------------------------------------------------------
  11584. # palm:  file(1) magic for PalmOS {.prc,.pdb}: applications, docfiles, and hacks
  11585. #
  11586. # Brian Lalor <blalor@hcirisc.cs.binghamton.edu>
  11587.  
  11588. # appl
  11589. 60      belong                  0x6170706c      PalmOS application
  11590. >0      string                  >\0             "%s"
  11591. # TEXt
  11592. 60      belong                  0x54455874      AportisDoc file
  11593. >0      string                  >\0             "%s"
  11594. # HACK
  11595. 60      belong                  0x4841434b      HackMaster hack
  11596. >0      string                  >\0             "%s"
  11597.  
  11598. # Variety of PalmOS document types
  11599. # Michael-John Turner <mj@debian.org>
  11600. # Thanks to Hasan Umit Ezerce <humit@tr-net.net.tr> for his DocType
  11601. 60    string                    BVokBDIC    BDicty PalmOS document
  11602. >0    string                  >\0             "%s"
  11603. 60    string                    DB99DBOS    DB PalmOS document
  11604. >0    string                  >\0             "%s"
  11605. 60    string                    vIMGView    FireViewer/ImageViewer PalmOS document
  11606. >0    string                  >\0             "%s"
  11607. 60    string                    PmDBPmDB    HanDBase PalmOS document
  11608. >0    string                  >\0             "%s"
  11609. 60    string                    InfoINDB    InfoView PalmOS document
  11610. >0    string                  >\0             "%s"
  11611. 60    string                    ToGoToGo    iSilo PalmOS document
  11612. >0    string                  >\0             "%s"
  11613. 60    string                    JfDbJBas    JFile PalmOS document
  11614. >0    string                  >\0             "%s"
  11615. 60    string                    JfDbJFil    JFile Pro PalmOS document
  11616. >0    string                  >\0             "%s"
  11617. 60    string                    DATALSdb    List PalmOS document
  11618. >0    string                  >\0             "%s"
  11619. 60    string                    Mdb1Mdb1    MobileDB PalmOS document
  11620. >0    string                  >\0             "%s"
  11621. 60    string                    PNRdPPrs    PeanutPress PalmOS document
  11622. >0    string                  >\0             "%s"
  11623. 60    string                    DataPlkr    Plucker PalmOS document
  11624. >0    string                  >\0             "%s"
  11625. 60    string                    DataSprd    QuickSheet PalmOS document
  11626. >0    string                  >\0             "%s"
  11627. 60    string                    SM01SMem    SuperMemo PalmOS document
  11628. >0    string                  >\0             "%s"
  11629. 60    string                    TEXtTlDc    TealDoc PalmOS document
  11630. >0    string                  >\0             "%s"
  11631. 60    string                    InfoTlIf    TealInfo PalmOS document
  11632. >0    string                  >\0             "%s"
  11633. 60    string                    DataTlMl    TealMeal PalmOS document
  11634. >0    string                  >\0             "%s"
  11635. 60    string                    DataTlPt    TealPaint PalmOS document
  11636. >0    string                  >\0             "%s"
  11637. 60    string                    dataTDBP    ThinkDB PalmOS document
  11638. >0    string                  >\0             "%s"
  11639. 60    string                    TdatTide    Tides PalmOS document
  11640. >0    string                  >\0             "%s"
  11641. 60    string                    ToRaTRPW    TomeRaider PalmOS document
  11642. >0    string                  >\0             "%s"
  11643.  
  11644. # A GutenPalm zTXT etext for use on Palm Pilots (http://gutenpalm.sf.net)
  11645. # For version 1.xx zTXTs, outputs version and numbers of bookmarks and
  11646. #   annotations.
  11647. # For other versions, just outputs version.
  11648. #
  11649. 60        string        zTXT        A GutenPalm zTXT e-book
  11650. >0        string        >\0        "%s"
  11651. >(0x4E.L)    byte        0
  11652. >>(0x4E.L+1)    byte        x        (v0.%02d)
  11653. >(0x4E.L)    byte        1
  11654. >>(0x4E.L+1)    byte        x        (v1.%02d)
  11655. >>>(0x4E.L+10)    beshort        >0
  11656. >>>>(0x4E.L+10) beshort        <2        - 1 bookmark
  11657. >>>>(0x4E.L+10) beshort        >1        - %d bookmarks
  11658. >>>(0x4E.L+14)    beshort        >0
  11659. >>>>(0x4E.L+14) beshort        <2        - 1 annotation
  11660. >>>>(0x4E.L+14) beshort        >1        - %d annotations
  11661. >(0x4E.L)    byte        >1        (v%d.
  11662. >>(0x4E.L+1)    byte        x        %02d)
  11663.  
  11664. # Palm OS .prc file types
  11665. 60        string        libr        Palm OS dynamic library data
  11666. >0        string        >\0        "%s"
  11667. 60        string        ptch        Palm OS operating system patch data
  11668. >0        string        >\0        "%s"
  11669.  
  11670. # Mobipocket (www.mobipocket.com), donated by Carl Witty
  11671. 60    string                    BOOKMOBI    Mobipocket E-book
  11672. >0    string                  >\0             "%s"
  11673.  
  11674. #------------------------------------------------------------------------------
  11675. #
  11676. # Parix COFF executables
  11677. # From: Ignatios Souvatzis <ignatios@cs.uni-bonn.de>
  11678. #
  11679. 0    beshort&0xfff    0xACE    PARIX
  11680. >0    byte&0xf0    0x80    T800
  11681. >0    byte&0xf0    0x90    T9000
  11682. >19    byte&0x02    0x02    executable
  11683. >19    byte&0x02    0x00    object
  11684. >19    byte&0x0c    0x00    not stripped
  11685.  
  11686. #------------------------------------------------------------------------------
  11687. # pbm:  file(1) magic for Portable Bitmap files
  11688. #
  11689. # XXX - byte order?
  11690. #
  11691. 0    short    0x2a17    "compact bitmap" format (Poskanzer)
  11692. #------------------------------------------------------------------------------
  11693. # pdf:  file(1) magic for Portable Document Format
  11694. #
  11695.  
  11696. 0    string        %PDF-        PDF document
  11697. !:mime    application/pdf
  11698. >5    byte        x        \b, version %c
  11699. >7    byte        x        \b.%c
  11700.  
  11701. # From: Nick Schmalenberger <nick@schmalenberger.us>
  11702. # Forms Data Format
  11703. 0       string          %FDF-           FDF document
  11704. >5      byte            x               \b, version %c
  11705. >7      byte            x               \b.%c
  11706.  
  11707. #------------------------------------------------------------------------------
  11708. # pdp:  file(1) magic for PDP-11 executable/object and APL workspace
  11709. #
  11710. 0    lelong        0101555        PDP-11 single precision APL workspace
  11711. 0    lelong        0101554        PDP-11 double precision APL workspace
  11712. #
  11713. # PDP-11 a.out
  11714. #
  11715. 0    leshort        0407        PDP-11 executable
  11716. >8    leshort        >0        not stripped
  11717. >15    byte        >0        - version %ld
  11718.  
  11719. 0    leshort        0401        PDP-11 UNIX/RT ldp
  11720. 0    leshort        0405        PDP-11 old overlay
  11721.  
  11722. 0    leshort        0410        PDP-11 pure executable
  11723. >8    leshort        >0        not stripped
  11724. >15    byte        >0        - version %ld
  11725.  
  11726. 0    leshort        0411        PDP-11 separate I&D executable
  11727. >8    leshort        >0        not stripped
  11728. >15    byte        >0        - version %ld
  11729.  
  11730. 0    leshort        0437        PDP-11 kernel overlay
  11731.  
  11732. # These last three are derived from 2.11BSD file(1)
  11733. 0    leshort        0413        PDP-11 demand-paged pure executable
  11734. >8    leshort        >0        not stripped
  11735.  
  11736. 0    leshort        0430        PDP-11 overlaid pure executable
  11737. >8    leshort        >0        not stripped
  11738.  
  11739. 0    leshort        0431        PDP-11 overlaid separate executable
  11740. >8    leshort        >0        not stripped
  11741. #------------------------------------------------------------------------------
  11742. # perl:  file(1) magic for Larry Wall's perl language.
  11743. #
  11744. # The `eval' lines recognizes an outrageously clever hack.
  11745. # Keith Waclena <keith@cerberus.uchicago.edu>
  11746. # Send additions to <perl5-porters@perl.org>
  11747. 0    search/1/b    #!\ /bin/perl            Perl script text executable
  11748. !:mime    text/x-perl
  11749. 0    search/1    eval\ "exec\ /bin/perl        Perl script text
  11750. !:mime    text/x-perl
  11751. 0    search/1/b    #!\ /usr/bin/perl        Perl script text executable
  11752. !:mime    text/x-perl
  11753. 0    search/1    eval\ "exec\ /usr/bin/perl    Perl script text
  11754. !:mime    text/x-perl
  11755. 0    search/1/b    #!\ /usr/local/bin/perl        Perl script text executable
  11756. !:mime    text/x-perl
  11757. 0    search/1    eval\ "exec\ /usr/local/bin/perl    Perl script text
  11758. !:mime    text/x-perl
  11759. 0    search/1    eval\ '(exit\ $?0)'\ &&\ eval\ 'exec    Perl script text
  11760. !:mime    text/x-perl
  11761.  
  11762.  
  11763. # by Dmitry V. Levin and Alexey Tourbin
  11764. # check the first line
  11765. 0    search/1    package
  11766. 0    regex        \^package[\ \t]+[A-Za-z_]
  11767. >0    regex        \^package[\ \t]+[0-9A-Za-z_:]+\ *;    Perl5 module source text
  11768. # not 'p', check other lines
  11769. 0    search/1    !p
  11770. >0    regex        \^package[\ \t]+[0-9A-Za-z_:]+\ *;
  11771. >>0    regex        \^1\ *;|\^(use|sub|my)\ .*[(;{=]    Perl5 module source text
  11772.  
  11773.  
  11774.  
  11775. # Perl POD documents
  11776. # From: Tom Hukins <tom@eborcom.com>
  11777. 0    search/1/B    \=pod\n        Perl POD document text
  11778. 0    search/1/B    \n\=pod\n    Perl POD document text
  11779. 0    search/1/B    \=head1\     Perl POD document text
  11780. 0    search/1/B    \n\=head1\     Perl POD document text
  11781. 0    search/1/B    \=head2\     Perl POD document text
  11782. 0    search/1/B    \n\=head2\     Perl POD document text
  11783.  
  11784. # Perl Storable data files.
  11785. 0    string    perl-store    perl Storable (v0.6) data
  11786. >4    byte    >0    (net-order %d)
  11787. >>4    byte    &01    (network-ordered)
  11788. >>4    byte    =3    (major 1)
  11789. >>4    byte    =2    (major 1)
  11790.  
  11791. 0    string    pst0    perl Storable (v0.7) data
  11792. >4    byte    >0
  11793. >>4    byte    &01    (network-ordered)
  11794. >>4    byte    =5    (major 2)
  11795. >>4    byte    =4    (major 2)
  11796. >>5    byte    >0    (minor %d)
  11797.  
  11798. #------------------------------------------------------------------------------
  11799. # pgp:  file(1) magic for Pretty Good Privacy
  11800. # see http://lists.gnupg.org/pipermail/gnupg-devel/1999-September/016052.html
  11801. #
  11802. 0       beshort         0x9900                  PGP key public ring
  11803. !:mime    application/x-pgp-keyring
  11804. 0       beshort         0x9501                  PGP key security ring
  11805. !:mime    application/x-pgp-keyring
  11806. 0       beshort         0x9500                  PGP key security ring
  11807. !:mime    application/x-pgp-keyring
  11808. 0    beshort        0xa600            PGP encrypted data
  11809. #!:mime    application/pgp-encrypted
  11810. #0    string        -----BEGIN\040PGP    text/PGP armored data
  11811. !:mime    text/PGP # encoding: armored data
  11812. #>15    string    PUBLIC\040KEY\040BLOCK-    public key block
  11813. #>15    string    MESSAGE-        message
  11814. #>15    string    SIGNED\040MESSAGE-    signed message
  11815. #>15    string    PGP\040SIGNATURE-    signature
  11816.  
  11817. 2    string    ---BEGIN\ PGP\ PUBLIC\ KEY\ BLOCK-    PGP public key block
  11818. !:mime    application/pgp-keys
  11819. 0    string    -----BEGIN\040PGP\40MESSAGE-        PGP message
  11820. !:mime    application/pgp
  11821. 0    string    -----BEGIN\040PGP\40SIGNATURE-        PGP signature
  11822. !:mime    application/pgp-signature
  11823.  
  11824. #------------------------------------------------------------------------------
  11825. # pkgadd:  file(1) magic for SysV R4 PKG Datastreams
  11826. #
  11827. 0       string          #\ PaCkAgE\ DaTaStReAm  pkg Datastream (SVR4)
  11828. !:mime    application/x-svr4-package
  11829.  
  11830. #------------------------------------------------------------------------------
  11831. # plan9:  file(1) magic for AT&T Bell Labs' Plan 9 executables
  11832. # From: "Stefan A. Haubenthal" <polluks@web.de>
  11833. #
  11834. 0    belong        0x00000107    Plan 9 executable, Motorola 68k
  11835. 0    belong        0x000001EB    Plan 9 executable, Intel 386
  11836. 0    belong        0x00000247    Plan 9 executable, Intel 960
  11837. 0    belong        0x000002AB    Plan 9 executable, SPARC
  11838. 0    belong        0x00000407    Plan 9 executable, MIPS R3000
  11839. 0    belong        0x0000048B    Plan 9 executable, AT&T DSP 3210
  11840. 0    belong        0x00000517    Plan 9 executable, MIPS R4000 BE
  11841. 0    belong        0x000005AB    Plan 9 executable, AMD 29000
  11842. 0    belong        0x00000647    Plan 9 executable, ARM 7-something
  11843. 0    belong        0x000006EB    Plan 9 executable, PowerPC
  11844. 0    belong        0x00000797    Plan 9 executable, MIPS R4000 LE
  11845. 0    belong        0x0000084B    Plan 9 executable, DEC Alpha
  11846.  
  11847. #------------------------------------------------------------------------------
  11848. # plus5:  file(1) magic for Plus Five's UNIX MUMPS
  11849. #
  11850. # XXX - byte order?  Paging Hokey....
  11851. #
  11852. 0    short        0x259        mumps avl global
  11853. >2    byte        >0        (V%d)
  11854. >6    byte        >0        with %d byte name
  11855. >7    byte        >0        and %d byte data cells
  11856. 0    short        0x25a        mumps blt global
  11857. >2    byte        >0        (V%d)
  11858. >8    short        >0        - %d byte blocks
  11859. >15    byte        0x00        - P/D format
  11860. >15    byte        0x01        - P/K/D format
  11861. >15    byte        0x02        - K/D format
  11862. >15    byte        >0x02        - Bad Flags
  11863.  
  11864. #------------------------------------------------------------------------------
  11865. # printer:  file(1) magic for printer-formatted files
  11866. #
  11867.  
  11868. # PostScript, updated by Daniel Quinlan (quinlan@yggdrasil.com)
  11869. 0    string        %!        PostScript document text
  11870. !:mime    application/postscript
  11871. >2    string        PS-Adobe-    conforming
  11872. >>11    string        >\0        DSC level %.3s
  11873. >>>15    string        EPS        \b, type %s
  11874. >>>15    string        Query        \b, type %s
  11875. >>>15    string        ExitServer    \b, type %s
  11876. >>>15   search/1000        %%LanguageLevel:\ 
  11877. >>>>&0    string        >\0        \b, Level %s
  11878. # Some PCs have the annoying habit of adding a ^D as a document separator
  11879. 0    string        \004%!        PostScript document text
  11880. !:mime    application/postscript
  11881. >3    string        PS-Adobe-    conforming
  11882. >>12    string        >\0        DSC level %.3s
  11883. >>>16    string        EPS        \b, type %s
  11884. >>>16    string        Query        \b, type %s
  11885. >>>16    string        ExitServer    \b, type %s
  11886. >>>16   search/1000        %%LanguageLevel:\ 
  11887. >>>>&0    string        >\0        \b, Level %s
  11888. 0    string        \033%-12345X%!PS    PostScript document
  11889.  
  11890. # DOS EPS Binary File Header
  11891. # From: Ed Sznyter <ews@Black.Market.NET>
  11892. 0       belong          0xC5D0D3C6      DOS EPS Binary File
  11893. >4      long            >0              Postscript starts at byte %d
  11894. >>8     long            >0              length %d
  11895. >>>12   long            >0              Metafile starts at byte %d
  11896. >>>>16  long            >0              length %d
  11897. >>>20   long            >0              TIFF starts at byte %d
  11898. >>>>24  long            >0              length %d
  11899.  
  11900. # Summary: Adobe's PostScript Printer Description File
  11901. # Extension: .ppd
  11902. # Reference: http://partners.adobe.com/public/developer/en/ps/5003.PPD_Spec_v4.3.pdf, Section 3.8
  11903. # Submitted by: Yves Arrouye <arrouye@marin.fdn.fr>
  11904. #
  11905. 0    string        *PPD-Adobe:\x20    PPD file
  11906. >&0    string        x        \b, version %s
  11907.  
  11908. # HP Printer Job Language
  11909. 0    string        \033%-12345X@PJL    HP Printer Job Language data
  11910. # HP Printer Job Language
  11911. # The header found on Win95 HP plot files is the "Silliest Thing possible" 
  11912. # (TM)
  11913. # Every driver puts the language at some random position, with random case
  11914. # (LANGUAGE and Language)
  11915. # For example the LaserJet 5L driver puts the "PJL ENTER LANGUAGE" in line 10
  11916. # From: Uwe Bonnes <bon@elektron.ikp.physik.th-darmstadt.de>
  11917. 0    string        \033%-12345X@PJL    HP Printer Job Language data
  11918. >&0    string        >\0            %s            
  11919. >>&0    string        >\0            %s            
  11920. >>>&0    string        >\0            %s        
  11921. >>>>&0    string        >\0            %s        
  11922. #>15    string        \ ENTER\ LANGUAGE\ =
  11923. #>31    string        PostScript        PostScript
  11924.  
  11925. # HP Printer Control Language, Daniel Quinlan (quinlan@yggdrasil.com)
  11926. 0    string        \033E\033    HP PCL printer data
  11927. >3    string        \&l0A        - default page size
  11928. >3    string        \&l1A        - US executive page size
  11929. >3    string        \&l2A        - US letter page size
  11930. >3    string        \&l3A        - US legal page size
  11931. >3    string        \&l26A        - A4 page size
  11932. >3    string        \&l80A        - Monarch envelope size
  11933. >3    string        \&l81A        - No. 10 envelope size
  11934. >3    string        \&l90A        - Intl. DL envelope size
  11935. >3    string        \&l91A        - Intl. C5 envelope size
  11936. >3    string        \&l100A        - Intl. B5 envelope size
  11937. >3    string        \&l-81A        - No. 10 envelope size (landscape)
  11938. >3    string        \&l-90A        - Intl. DL envelope size (landscape)
  11939.  
  11940. # IMAGEN printer-ready files:
  11941. 0    string    @document(        Imagen printer
  11942. # this only works if "language xxx" is first item in Imagen header.
  11943. >10    string    language\ impress    (imPRESS data)
  11944. >10    string    language\ daisy        (daisywheel text)
  11945. >10    string    language\ diablo    (daisywheel text)
  11946. >10    string    language\ printer    (line printer emulation)
  11947. >10    string    language\ tektronix    (Tektronix 4014 emulation)
  11948. # Add any other languages that your Imagen uses - remember
  11949. # to keep the word `text' if the file is human-readable.
  11950. # [GRR 950115:  missing "postscript" or "ultrascript" (whatever it was called)]
  11951. #
  11952. # Now magic for IMAGEN font files...
  11953. 0    string        Rast        RST-format raster font data
  11954. >45    string        >0        face %s
  11955. # From Jukka Ukkonen
  11956. 0    string        \033[K\002\0\0\017\033(a\001\0\001\033(g    Canon Bubble Jet BJC formatted data
  11957.  
  11958. # From <mike@flyn.org>
  11959. # These are the /etc/magic entries to decode data sent to an Epson printer.
  11960. 0       string          \x1B\x40\x1B\x28\x52\x08\x00\x00REMOTE1P        Epson Stylus Color 460 data
  11961.  
  11962.  
  11963. #------------------------------------------------------------------------------
  11964. # zenographics:  file(1) magic for Zenographics ZjStream printer data
  11965. # Rick Richardson  rickr@mn.rr.com
  11966. 0    string        JZJZ
  11967. >0x12    string        ZZ        Zenographics ZjStream printer data (big-endian)
  11968. 0    string        ZJZJ
  11969. >0x12    string        ZZ        Zenographics ZjStream printer data (little-endian)
  11970.  
  11971.  
  11972. #------------------------------------------------------------------------------
  11973. # Oak Technologies printer stream
  11974. # Rick Richardson <rickr@mn.rr.com>
  11975. 0       string          OAK
  11976. >0x07    byte        0
  11977. >0x0b    byte        0    Oak Technologies printer stream
  11978.  
  11979. # This would otherwise be recognized as PostScript - nick@debian.org
  11980. 0    string        %!VMF         SunClock's Vector Map Format data
  11981.  
  11982. #------------------------------------------------------------------------------
  11983. # HP LaserJet 1000 series downloadable firmware file
  11984. 0    string    \xbe\xefABCDEFGH    HP LaserJet 1000 series downloadable firmware   
  11985.  
  11986. # From: Paolo <oopla@users.sf.net>
  11987. # Epson ESC/Page, ESC/PageColor 
  11988. 0    string    \x1b\x01@EJL    Epson ESC/Page language printer data
  11989.  
  11990. #------------------------------------------------------------------------------
  11991. # project:  file(1) magic for Project management
  11992. # Magic strings for ftnchek project files. Alexander Mai
  11993. 0    string    FTNCHEK_\ P    project file for ftnchek
  11994. >10    string    1        version 2.7
  11995. >10    string    2        version 2.8 to 2.10
  11996. >10    string    3        version 2.11 or later
  11997.  
  11998. #------------------------------------------------------------------------------
  11999. # psdbms:  file(1) magic for psdatabase
  12000. #
  12001. 0    belong&0xff00ffff    0x56000000    ps database
  12002. >1    string    >\0    version %s
  12003. >4    string    >\0    from kernel %s
  12004. #------------------------------------------------------------------------------
  12005. # psion:  file(1) magic for Psion handhelds data
  12006. # from: Peter Breitenlohner <peb@mppmu.mpg.de>
  12007. #
  12008. 0    lelong        0x10000037    Psion Series 5
  12009. >4    lelong        0x10000039    font file
  12010. >4    lelong        0x1000003A    printer driver
  12011. >4    lelong        0x1000003B    clipboard
  12012. >4    lelong        0x10000042    multi-bitmap image
  12013. >4    lelong        0x1000006A    application information file
  12014. >4    lelong        0x1000006D
  12015. >>8    lelong        0x1000007D    sketch image
  12016. !:mime image/x-psion-sketch
  12017. >>8    lelong        0x1000007E    voice note
  12018. >>8    lelong        0x1000007F    word file
  12019. >>8    lelong        0x10000085    OPL program
  12020. >>8    lelong        0x10000088    sheet file
  12021. >>8    lelong        0x100001C4    EasyFax initialisation file
  12022. >4    lelong        0x10000073    OPO module
  12023. >4    lelong        0x10000074    OPL application
  12024. >4    lelong        0x1000008A    exported multi-bitmap image
  12025.  
  12026. 0    lelong        0x10000041    Psion Series 5 ROM multi-bitmap image
  12027.  
  12028. 0    lelong        0x10000050    Psion Series 5
  12029. >4    lelong        0x1000006D    database
  12030. >4    lelong        0x100000E4    ini file
  12031.  
  12032. 0    lelong        0x10000079    Psion Series 5 binary:
  12033. >4    lelong        0x00000000    DLL
  12034. >4    lelong        0x10000049    comms hardware library
  12035. >4    lelong        0x1000004A    comms protocol library
  12036. >4    lelong        0x1000005D    OPX
  12037. >4    lelong        0x1000006C    application
  12038. >4    lelong        0x1000008D    DLL
  12039. >4    lelong        0x100000AC    logical device driver
  12040. >4    lelong        0x100000AD    physical device driver
  12041. >4    lelong        0x100000E5    file transfer protocol
  12042. >4    lelong        0x100000E5    file transfer protocol
  12043. >4    lelong        0x10000140    printer definition
  12044. >4    lelong        0x10000141    printer definition
  12045.  
  12046. 0    lelong        0x1000007A    Psion Series 5 executable
  12047.  
  12048. #------------------------------------------------------------------------------
  12049. # pulsar:  file(1) magic for Pulsar POP3 daemon binary files
  12050. #
  12051. # http://pulsar.sourceforge.net
  12052. # mailto:rok.papez@lugos.si
  12053. #
  12054.  
  12055. 0    belong    0x1ee7f11e    Pulsar POP3 daemon mailbox cache file.
  12056. >4    ubelong    x        Version: %d.
  12057. >8    ubelong    x        \b%d
  12058.  
  12059.  
  12060. #------------------------------------------------------------------------------
  12061. # pyramid:  file(1) magic for Pyramids
  12062. #
  12063. # XXX - byte order?
  12064. #
  12065. 0    long        0x50900107    Pyramid 90x family executable
  12066. 0    long        0x50900108    Pyramid 90x family pure executable
  12067. >16    long        >0        not stripped
  12068. 0    long        0x5090010b    Pyramid 90x family demand paged pure executable
  12069. >16    long        >0        not stripped
  12070.  
  12071. #------------------------------------------------------------------------------
  12072. # python:  file(1) magic for python
  12073. #
  12074. # From: David Necas <yeti@physics.muni.cz>
  12075. # often the module starts with a multiline string
  12076. 0    string        """    a python script text executable
  12077. # MAGIC as specified in Python/import.c (1.5 to 2.3.0a)
  12078. # 20121  ( YEAR - 1995 ) + MONTH  + DAY (little endian followed by "\r\n"
  12079. 0    belong        0x994e0d0a    python 1.5/1.6 byte-compiled
  12080. 0    belong        0x87c60d0a    python 2.0 byte-compiled
  12081. 0    belong        0x2aeb0d0a    python 2.1 byte-compiled
  12082. 0    belong        0x2ded0d0a    python 2.2 byte-compiled
  12083. 0    belong        0x3bf20d0a    python 2.3 byte-compiled
  12084. 0    belong        0x6df20d0a    python 2.4 byte-compiled
  12085. 0    belong        0xb3f20d0a    python 2.5 byte-compiled
  12086.  
  12087. 0    string/b  #!\ /usr/bin/python    python script text executable
  12088.  
  12089.  
  12090. #------------------------------------------------------------------------------
  12091. # file(1) magic for revision control files
  12092. # From Hendrik Scholz <hendrik@scholz.net>
  12093. 0    string    /1\ :pserver:    cvs password text file
  12094.  
  12095. # Conary changesets
  12096. # From: Jonathan Smith <smithj@rpath.com>
  12097. 0    belong    0xea3f81bb    Conary changeset data
  12098.  
  12099. # Type: Git bundles (git-bundle)
  12100. # From: Josh Triplett <josh@freedesktop.org>
  12101. 0    string    #\ v2\ git\ bundle\n    Git bundle
  12102.  
  12103. # Type:    Mercurial bundles
  12104. # From:    Seo Sanghyeon <tinuviel@sparcs.kaist.ac.kr>
  12105. 0    string    HG10        Mercurial bundle,
  12106. >4    string    UN        uncompressed
  12107. >4    string    BZ        bzip2 compressed
  12108.  
  12109. # Type:    Subversion (SVN) dumps
  12110. # From:    Uwe Zeisberger <zeisberg@informatik.uni-freiburg.de>
  12111. 0    string    SVN-fs-dump-format-version:    Subversion dumpfile
  12112. >28    string    >\0                (version: %s)
  12113.  
  12114. # Type:    Bazaar revision bundles and merge requests
  12115. # URL:    http://www.bazaar-vcs.org/
  12116. # From:    Jelmer Vernooij <jelmer@samba.org>
  12117. 0    string    #\ Bazaar\ revision\ bundle\ v Bazaar Bundle
  12118. 0    string    #\ Bazaar\ merge\ directive\ format Bazaar merge directive
  12119.  
  12120. #------------------------------------------------------------------------------
  12121. # riff:  file(1) magic for RIFF format
  12122. # See
  12123. #
  12124. #    http://www.seanet.com/users/matts/riffmci/riffmci.htm
  12125. #
  12126. # AVI section extended by Patrik RƂdman <patrik+file-magic@iki.fi>
  12127. #
  12128. 0    string        RIFF        RIFF (little-endian) data
  12129. # RIFF Palette format
  12130. >8    string        PAL        \b, palette
  12131. >>16    leshort        x        \b, version %d
  12132. >>18    leshort        x        \b, %d entries
  12133. # RIFF Device Independent Bitmap format
  12134. >8    string        RDIB        \b, device-independent bitmap
  12135. >>16    string        BM        
  12136. >>>30    leshort        12        \b, OS/2 1.x format
  12137. >>>>34    leshort        x        \b, %d x
  12138. >>>>36    leshort        x        %d
  12139. >>>30    leshort        64        \b, OS/2 2.x format
  12140. >>>>34    leshort        x        \b, %d x
  12141. >>>>36    leshort        x        %d
  12142. >>>30    leshort        40        \b, Windows 3.x format
  12143. >>>>34    lelong        x        \b, %d x
  12144. >>>>38    lelong        x        %d x
  12145. >>>>44    leshort        x        %d
  12146. # RIFF MIDI format
  12147. >8    string        RMID        \b, MIDI
  12148. # RIFF Multimedia Movie File format
  12149. >8    string        RMMP        \b, multimedia movie
  12150. # RIFF wrapper for MP3
  12151. >8    string        RMP3        \b, MPEG Layer 3 audio
  12152. # Microsoft WAVE format (*.wav)
  12153. >8    string        WAVE        \b, WAVE audio
  12154. !:mime    audio/x-wav
  12155. >>20    leshort        1        \b, Microsoft PCM
  12156. >>>34    leshort        >0        \b, %d bit
  12157. >>20    leshort        2        \b, Microsoft ADPCM
  12158. >>20    leshort        6        \b, ITU G.711 A-law
  12159. >>20    leshort        7        \b, ITU G.711 mu-law
  12160. >>20    leshort        8        \b, Microsoft DTS
  12161. >>20    leshort        17        \b, IMA ADPCM
  12162. >>20    leshort        20        \b, ITU G.723 ADPCM (Yamaha)
  12163. >>20    leshort        49        \b, GSM 6.10
  12164. >>20    leshort        64        \b, ITU G.721 ADPCM
  12165. >>20    leshort        80        \b, MPEG
  12166. >>20    leshort        85        \b, MPEG Layer 3
  12167. >>20    leshort        0x2001        \b, DTS
  12168. >>22    leshort        =1        \b, mono
  12169. >>22    leshort        =2        \b, stereo
  12170. >>22    leshort        >2        \b, %d channels
  12171. >>24    lelong        >0        %d Hz
  12172. # Corel Draw Picture
  12173. >8    string        CDRA        \b, Corel Draw Picture
  12174. !:mime    image/x-coreldraw
  12175. # AVI == Audio Video Interleave
  12176. >8    string        AVI\040        \b, AVI
  12177. !:mime    video/x-msvideo
  12178. >>12    string          LIST
  12179. >>>20   string          hdrlavih
  12180. >>>>&36 lelong          x               \b, %lu x
  12181. >>>>&40 lelong          x               %lu,
  12182. >>>>&4  lelong          >1000000        <1 fps,
  12183. >>>>&4  lelong          1000000         1.00 fps,
  12184. >>>>&4  lelong          500000          2.00 fps,
  12185. >>>>&4  lelong          333333          3.00 fps,
  12186. >>>>&4  lelong          250000          4.00 fps,
  12187. >>>>&4  lelong          200000          5.00 fps,
  12188. >>>>&4  lelong          166667          6.00 fps,
  12189. >>>>&4  lelong          142857          7.00 fps,
  12190. >>>>&4  lelong          125000          8.00 fps,
  12191. >>>>&4  lelong          111111          9.00 fps,
  12192. >>>>&4  lelong          100000          10.00 fps,
  12193. # ]9.9,10.1[
  12194. >>>>&4  lelong          <101010
  12195. >>>>>&-4        lelong  >99010
  12196. >>>>>>&-4       lelong  !100000         ~10 fps,
  12197. >>>>&4  lelong          83333           12.00 fps,
  12198. # ]11.9,12.1[
  12199. >>>>&4  lelong          <84034
  12200. >>>>>&-4        lelong  >82645
  12201. >>>>>>&-4       lelong  !83333          ~12 fps,
  12202. >>>>&4  lelong          66667           15.00 fps,
  12203. # ]14.9,15.1[
  12204. >>>>&4  lelong          <67114
  12205. >>>>>&-4        lelong  >66225
  12206. >>>>>>&-4       lelong  !66667          ~15 fps,
  12207. >>>>&4  lelong          50000           20.00 fps,
  12208. >>>>&4  lelong          41708           23.98 fps,
  12209. >>>>&4  lelong          41667           24.00 fps,
  12210. # ]23.9,24.1[
  12211. >>>>&4  lelong          <41841
  12212. >>>>>&-4        lelong  >41494
  12213. >>>>>>&-4       lelong  !41708
  12214. >>>>>>>&-4      lelong  !41667          ~24 fps,
  12215. >>>>&4  lelong          40000           25.00 fps,
  12216. # ]24.9,25.1[
  12217. >>>>&4  lelong          <40161
  12218. >>>>>&-4        lelong  >39841
  12219. >>>>>>&-4       lelong  !40000          ~25 fps,
  12220. >>>>&4  lelong          33367           29.97 fps,
  12221. >>>>&4  lelong          33333           30.00 fps,
  12222. # ]29.9,30.1[
  12223. >>>>&4  lelong          <33445
  12224. >>>>>&-4        lelong  >33223
  12225. >>>>>>&-4       lelong  !33367
  12226. >>>>>>>&-4      lelong  !33333          ~30 fps,
  12227. >>>>&4  lelong          <32224          >30 fps,
  12228. ##>>>>&4  lelong          x               (%lu)
  12229. ##>>>>&20 lelong          x               %lu frames,
  12230. # Note: The tests below assume that the AVI has 1 or 2 streams,
  12231. #       "vids" optionally followed by "auds".
  12232. #       (Should cover 99.9% of all AVIs.)
  12233. # assuming avih length = 56
  12234. >>>88   string  LIST
  12235. >>>>96  string  strlstrh
  12236. >>>>>108        string  vids    video:
  12237. >>>>>>&0        lelong  0               uncompressed
  12238. # skip past vids strh
  12239. >>>>>>(104.l+108)       string  strf
  12240. >>>>>>>(104.l+132)      lelong          1       RLE 8bpp
  12241. >>>>>>>(104.l+132)      string/c        cvid    Cinepak
  12242. >>>>>>>(104.l+132)      string/c        i263    Intel I.263
  12243. >>>>>>>(104.l+132)      string/c        iv32    Indeo 3.2
  12244. >>>>>>>(104.l+132)      string/c        iv41    Indeo 4.1
  12245. >>>>>>>(104.l+132)      string/c        iv50    Indeo 5.0
  12246. >>>>>>>(104.l+132)      string/c        mp42    Microsoft MPEG-4 v2
  12247. >>>>>>>(104.l+132)      string/c        mp43    Microsoft MPEG-4 v3
  12248. >>>>>>>(104.l+132)      string/c        fmp4    FFMpeg MPEG-4
  12249. >>>>>>>(104.l+132)      string/c        mjpg    Motion JPEG
  12250. >>>>>>>(104.l+132)      string/c        div3    DivX 3
  12251. >>>>>>>>112             string/c        div3    Low-Motion
  12252. >>>>>>>>112             string/c        div4    Fast-Motion
  12253. >>>>>>>(104.l+132)      string/c        divx    DivX 4
  12254. >>>>>>>(104.l+132)      string/c        dx50    DivX 5
  12255. >>>>>>>(104.l+132)      string/c        xvid    XviD
  12256. >>>>>>>(104.l+132)    string/c    h264    H.264
  12257. >>>>>>>(104.l+132)      string/c        wmv3    Windows Media Video 9
  12258. >>>>>>>(104.l+132)      string/c        h264    X.264 or H.264
  12259. >>>>>>>(104.l+132)      lelong  0
  12260. ##>>>>>>>(104.l+132)      string  x       (%.4s)
  12261. # skip past first (video) LIST
  12262. >>>>(92.l+96)   string  LIST
  12263. >>>>>(92.l+104) string  strlstrh
  12264. >>>>>>(92.l+116)        string          auds    \b, audio:
  12265. # auds strh length = 56:
  12266. >>>>>>>(92.l+172)       string          strf
  12267. >>>>>>>>(92.l+180)      leshort 0x0001  uncompressed PCM
  12268. >>>>>>>>(92.l+180)      leshort 0x0002  ADPCM
  12269. >>>>>>>>(92.l+180)      leshort 0x0006  aLaw
  12270. >>>>>>>>(92.l+180)      leshort 0x0007  uLaw
  12271. >>>>>>>>(92.l+180)      leshort 0x0050  MPEG-1 Layer 1 or 2
  12272. >>>>>>>>(92.l+180)      leshort 0x0055  MPEG-1 Layer 3
  12273. >>>>>>>>(92.l+180)      leshort 0x2000  Dolby AC3
  12274. >>>>>>>>(92.l+180)      leshort 0x0161  DivX
  12275. ##>>>>>>>>(92.l+180)      leshort x       (0x%.4x)
  12276. >>>>>>>>(92.l+182)      leshort 1       (mono,
  12277. >>>>>>>>(92.l+182)      leshort 2       (stereo,
  12278. >>>>>>>>(92.l+182)      leshort >2      (%d channels,
  12279. >>>>>>>>(92.l+184)      lelong  x       %d Hz)
  12280. # auds strh length = 64:
  12281. >>>>>>>(92.l+180)       string          strf
  12282. >>>>>>>>(92.l+188)      leshort 0x0001  uncompressed PCM
  12283. >>>>>>>>(92.l+188)      leshort 0x0002  ADPCM
  12284. >>>>>>>>(92.l+188)      leshort 0x0055  MPEG-1 Layer 3
  12285. >>>>>>>>(92.l+188)      leshort 0x2000  Dolby AC3
  12286. >>>>>>>>(92.l+188)      leshort 0x0161  DivX
  12287. ##>>>>>>>>(92.l+188)      leshort x       (0x%.4x)
  12288. >>>>>>>>(92.l+190)      leshort 1       (mono,
  12289. >>>>>>>>(92.l+190)      leshort 2       (stereo,
  12290. >>>>>>>>(92.l+190)      leshort >2      (%d channels,
  12291. >>>>>>>>(92.l+192)      lelong  x       %d Hz)
  12292. # Animated Cursor format
  12293. >8    string        ACON        \b, animated cursor
  12294. # SoundFont 2 <mpruett@sgi.com>
  12295. >8    string        sfbk        SoundFont/Bank
  12296. # MPEG-1 wrapped in a RIFF, apparently
  12297. >8      string          CDXA            \b, wrapped MPEG-1 (CDXA)
  12298. >8    string        4XMV        \b, 4X Movie file 
  12299.  
  12300. #
  12301. # XXX - some of the below may only appear in little-endian form.
  12302. #
  12303. # Also "MV93" appears to be for one form of Macromedia Director
  12304. # files, and "GDMF" appears to be another multimedia format.
  12305. #
  12306. 0    string        RIFX        RIFF (big-endian) data
  12307. # RIFF Palette format
  12308. >8    string        PAL        \b, palette
  12309. >>16    beshort        x        \b, version %d
  12310. >>18    beshort        x        \b, %d entries
  12311. # RIFF Device Independent Bitmap format
  12312. >8    string        RDIB        \b, device-independent bitmap
  12313. >>16    string        BM        
  12314. >>>30    beshort        12        \b, OS/2 1.x format
  12315. >>>>34    beshort        x        \b, %d x
  12316. >>>>36    beshort        x        %d
  12317. >>>30    beshort        64        \b, OS/2 2.x format
  12318. >>>>34    beshort        x        \b, %d x
  12319. >>>>36    beshort        x        %d
  12320. >>>30    beshort        40        \b, Windows 3.x format
  12321. >>>>34    belong        x        \b, %d x
  12322. >>>>38    belong        x        %d x
  12323. >>>>44    beshort        x        %d
  12324. # RIFF MIDI format
  12325. >8    string        RMID        \b, MIDI
  12326. # RIFF Multimedia Movie File format
  12327. >8    string        RMMP        \b, multimedia movie
  12328. # Microsoft WAVE format (*.wav)
  12329. >8    string        WAVE        \b, WAVE audio
  12330. >>20    leshort        1        \b, Microsoft PCM
  12331. >>>34    leshort        >0        \b, %d bit
  12332. >>22    beshort        =1        \b, mono
  12333. >>22    beshort        =2        \b, stereo
  12334. >>22    beshort        >2        \b, %d channels
  12335. >>24    belong        >0        %d Hz
  12336. # Corel Draw Picture
  12337. >8    string        CDRA        \b, Corel Draw Picture
  12338. # AVI == Audio Video Interleave
  12339. >8    string        AVI\040        \b, AVI
  12340. # Animated Cursor format
  12341. >8    string        ACON        \b, animated cursor
  12342. # Notation Interchange File Format (big-endian only)
  12343. >8    string        NIFF        \b, Notation Interchange File Format
  12344. # SoundFont 2 <mpruett@sgi.com>
  12345. >8    string        sfbk        SoundFont/Bank
  12346. #------------------------------------------------------------------------------
  12347. #
  12348. # RPM: file(1) magic for Red Hat Packages   Erik Troan (ewt@redhat.com)
  12349. #
  12350. 0    beshort        0xedab
  12351. >2    beshort        0xeedb        RPM
  12352. !:mime    application/x-rpm
  12353. >>4    byte        x        v%d
  12354. >>6    beshort        0        bin
  12355. >>6    beshort        1        src
  12356. >>8    beshort        1        i386
  12357. >>8    beshort        2        Alpha
  12358. >>8    beshort        3        Sparc
  12359. >>8    beshort        4        MIPS
  12360. >>8    beshort        5        PowerPC
  12361. >>8    beshort        6        68000
  12362. >>8    beshort        7        SGI
  12363. >>8    beshort        8        RS6000
  12364. >>8    beshort        9        IA64
  12365. >>8    beshort        10        Sparc64
  12366. >>8    beshort        11        MIPSel
  12367. >>8    beshort        12        ARM
  12368. >>10    string        x        %s
  12369.  
  12370. #------------------------------------------------------------------------------
  12371. # rtf:    file(1) magic for Rich Text Format (RTF)
  12372. #
  12373. # Duncan P. Simpson, D.P.Simpson@dcs.warwick.ac.uk
  12374. #
  12375. 0    string        {\\rtf        Rich Text Format data,
  12376. !:mime    text/rtf
  12377. >5    string        1        version 1,
  12378. >>6    string        \\ansi        ANSI
  12379. >>6    string        \\mac        Apple Macintosh
  12380. >>6    string        \\pc        IBM PC, code page 437
  12381. >>6    string        \\pca        IBM PS/2, code page 850
  12382. >>6    default        x        unknown character set
  12383. >5    default        x        unknown version
  12384. #------------------------------------------------------------------------------
  12385. # ruby:  file(1) magic for Lua scripting language
  12386. # URL:  http://www.ruby-lang.org/
  12387. # From: Reuben Thomas <rrt@sc3d.org>
  12388.  
  12389. # Ruby scripts
  12390. 0    search/1/b    #!\ /usr/bin/ruby    Ruby script text executable
  12391. !:mime    application/x-ruby
  12392. 0    search/1/b    #!\ /usr/local/bin/ruby    Ruby script text executable
  12393. !:mime    application/x-ruby
  12394. 0    search/1    #!/usr/bin/env\ ruby    Ruby script text executable
  12395. !:mime    application/x-ruby
  12396. 0    search/1    #!\ /usr/bin/env\ ruby    Ruby script text executable
  12397. !:mime    application/x-ruby
  12398.  
  12399. #------------------------------------------------------------------------------
  12400. # sc:  file(1) magic for "sc" spreadsheet
  12401. #
  12402. 38    string        Spreadsheet    sc spreadsheet file
  12403. !:mime    application/x-sc
  12404.  
  12405. #------------------------------------------------------------------------------
  12406. # sccs:  file(1) magic for SCCS archives
  12407. #
  12408. # SCCS archive structure:
  12409. # \001h01207
  12410. # \001s 00276/00000/00000
  12411. # \001d D 1.1 87/09/23 08:09:20 ian 1 0
  12412. # \001c date and time created 87/09/23 08:09:20 by ian
  12413. # \001e
  12414. # \001u
  12415. # \001U
  12416. # ... etc.
  12417. # Now '\001h' happens to be the same as the 3B20's a.out magic number (0550).
  12418. # *Sigh*. And these both came from various parts of the USG.
  12419. # Maybe we should just switch everybody from SCCS to RCS!
  12420. # Further, you can't just say '\001h0', because the five-digit number
  12421. # is a checksum that could (presumably) have any leading digit,
  12422. # and we don't have regular expression matching yet. 
  12423. # Hence the following official kludge:
  12424. 8    string        \001s\             SCCS archive data
  12425. #------------------------------------------------------------------------------
  12426. # scientific:  file(1) magic for scientific formats 
  12427. #
  12428. # From: Joe Krahn <krahn@niehs.nih.gov>
  12429.  
  12430. ########################################################
  12431. # CCP4 data and plot files:
  12432. 0    string        MTZ\040        MTZ reflection file
  12433.  
  12434. 92    string        PLOT%%84    Plot84 plotting file
  12435. >52    byte        1        , Little-endian
  12436. >55    byte        1        , Big-endian
  12437.  
  12438. ########################################################
  12439. # Electron density MAP/MASK formats
  12440.  
  12441. 0    string        EZD_MAP    NEWEZD Electron Density Map
  12442. 109    string        MAP\040(  Old EZD Electron Density Map
  12443.  
  12444. 0    string/c    :-)\040Origin    BRIX Electron Density Map
  12445. >170    string        >0    , Sigma:%.12s
  12446. #>4    string        >0    %.178s
  12447. #>4    addr        x    %.178s
  12448.  
  12449. 7    string        18\040!NTITLE    XPLOR ASCII Electron Density Map
  12450. 9    string        \040!NTITLE\012\040REMARK    CNS ASCII electron density map
  12451.  
  12452. 208    string        MAP\040    CCP4 Electron Density Map
  12453. # Assumes same stamp for float and double (normal case)
  12454. >212    byte        17    \b, Big-endian
  12455. >212    byte        34    \b, VAX format
  12456. >212    byte        68    \b, Little-endian
  12457. >212    byte        85    \b, Convex native
  12458.  
  12459. ############################################################
  12460. # X-Ray Area Detector images
  12461. 0    string    R-AXIS4\ \ \     R-Axis Area Detector Image:
  12462. >796    lelong    <20        Little-endian, IP #%d,
  12463. >>768    lelong    >0        Size=%dx
  12464. >>772    lelong    >0        \b%d
  12465. >796    belong    <20        Big-endian, IP #%d,
  12466. >>768    belong    >0        Size=%dx
  12467. >>772    belong    >0        \b%d
  12468.  
  12469. 0    string    RAXIS\ \ \ \ \     R-Axis Area Detector Image, Win32:
  12470. >796    lelong    <20        Little-endian, IP #%d,
  12471. >>768    lelong    >0        Size=%dx
  12472. >>772    lelong    >0        \b%d
  12473. >796    belong    <20        Big-endian, IP #%d,
  12474. >>768    belong    >0        Size=%dx
  12475. >>772    belong    >0        \b%d
  12476.  
  12477.  
  12478. 1028    string    MMX\000\000\000\000\000\000\000\000\000\000\000\000\000    MAR Area Detector Image,
  12479. >1072    ulong    >1        Compressed(%d),
  12480. >1100    ulong    >1        %d headers,
  12481. >1104    ulong    >0        %d x
  12482. >1108    ulong    >0        %d,
  12483. >1120    ulong    >0        %d bits/pixel
  12484.  
  12485. # Type: GEDCOM genealogical (family history) data
  12486. # From: Giuseppe Bilotta
  12487. 0       search/1/c    0\ HEAD         GEDCOM genealogy text
  12488. >&0     search        1\ GEDC
  12489. >>&0    search        2\ VERS         version
  12490. >>>&1   search/1    >\0        %s
  12491. # From: Phil Endecott <phil05@chezphil.org>
  12492. 0    string    \000\060\000\040\000\110\000\105\000\101\000\104        GEDCOM data
  12493. 0    string    \060\000\040\000\110\000\105\000\101\000\104\000        GEDCOM data
  12494. 0    string    \376\377\000\060\000\040\000\110\000\105\000\101\000\104    GEDCOM data
  12495. 0    string    \377\376\060\000\040\000\110\000\105\000\101\000\104\000    GEDCOM data
  12496. 0    search/1        -----BEGIN\ CERTIFICATE------    RFC1421 Security Certificate text
  12497. 0    search/1        -----BEGIN\ NEW\ CERTIFICATE    RFC1421 Security Certificate Signing Request text
  12498. 0    belong    0xedfeedfe    Sun 'jks' Java Keystore File data
  12499. # Type:    SE Linux policy modules *.pp reference policy
  12500. #    for Fedora 5 to 9, RHEL5, and Debian Etch and Lenny.
  12501. # URL:    http://doc.coker.com.au/computers/selinux-magic
  12502. # From:    Russell Coker <russell@coker.com.au>
  12503.  
  12504. 0        lelong    0xf97cff8f    SE Linux modular policy
  12505. >4        lelong    x        version %d,
  12506. >8        lelong    x        %d sections,
  12507. >>(12.l)    lelong    0xf97cff8d
  12508. >>>(12.l+27)    lelong    x        mod version %d,
  12509. >>>(12.l+31)    lelong    0        Not MLS,
  12510. >>>(12.l+31)    lelong    1        MLS,
  12511. >>>(12.l+23)    lelong    2
  12512. >>>>(12.l+47)    string    >\0        module name %s
  12513. >>>(12.l+23)    lelong    1        base
  12514.  
  12515. 1    string    policy_module(    SE Linux policy module source
  12516. 2    string    policy_module(    SE Linux policy module source
  12517.  
  12518. 0    string    ##\ <summary>    SE Linux policy interface source
  12519.  
  12520. #0    search    gen_context(    SE Linux policy file contexts
  12521.  
  12522. #0    search    gen_sens(    SE Linux policy MLS constraints source
  12523.  
  12524. #------------------------------------------------------------------------------
  12525. # sendmail:  file(1) magic for sendmail config files
  12526. #
  12527. # XXX - byte order?
  12528. #
  12529. 0    byte    046      Sendmail frozen configuration 
  12530. >16    string    >\0      - version %s
  12531. 0    short    0x271c      Sendmail frozen configuration
  12532. >16    string    >\0      - version %s
  12533.  
  12534. #------------------------------------------------------------------------------
  12535. # sendmail:  file(1) magic for sendmail m4(1) files
  12536. #
  12537. # From Hendrik Scholz <hendrik@scholz.net>
  12538. # i.e. files in /usr/share/sendmail/cf/
  12539. #
  12540. 0   string  divert(-1)\n    sendmail m4 text file
  12541.  
  12542.  
  12543. #------------------------------------------------------------------------------
  12544. # sequent:  file(1) magic for Sequent machines
  12545. #
  12546. # Sequent information updated by Don Dwiggins <atsun!dwiggins>.
  12547. # For Sequent's multiprocessor systems (incomplete).
  12548. 0    lelong    0x00ea            BALANCE NS32000 .o
  12549. >16    lelong    >0        not stripped
  12550. >124    lelong    >0        version %ld
  12551. 0    lelong    0x10ea            BALANCE NS32000 executable (0 @ 0)
  12552. >16    lelong  >0                not stripped
  12553. >124    lelong    >0        version %ld
  12554. 0    lelong    0x20ea            BALANCE NS32000 executable (invalid @ 0)
  12555. >16    lelong  >0                not stripped
  12556. >124    lelong    >0        version %ld
  12557. 0    lelong    0x30ea            BALANCE NS32000 standalone executable
  12558. >16    lelong  >0              not stripped
  12559. >124    lelong    >0        version %ld
  12560. #
  12561. # Symmetry information added by Jason Merrill <jason@jarthur.claremont.edu>.
  12562. # Symmetry magic nums will not be reached if DOS COM comes before them;
  12563. # byte 0xeb is matched before these get a chance.
  12564. 0    leshort    0x12eb        SYMMETRY i386 .o
  12565. >16    lelong    >0        not stripped
  12566. >124    lelong    >0        version %ld
  12567. 0    leshort    0x22eb        SYMMETRY i386 executable (0 @ 0)
  12568. >16    lelong    >0        not stripped
  12569. >124    lelong    >0        version %ld
  12570. 0    leshort    0x32eb        SYMMETRY i386 executable (invalid @ 0)
  12571. >16    lelong    >0        not stripped
  12572. >124    lelong    >0        version %ld
  12573. 0    leshort    0x42eb        SYMMETRY i386 standalone executable
  12574. >16    lelong    >0        not stripped
  12575. >124    lelong    >0        version %ld
  12576.  
  12577. #------------------------------------------------------------------------------
  12578. # sgi:  file(1) magic for Silicon Graphics applications
  12579.  
  12580. #
  12581. #
  12582. # Performance Co-Pilot file types
  12583. 0    string    PmNs                PCP compiled namespace (V.0)
  12584. 0    string    PmN                PCP compiled namespace
  12585. >3    string    >\0                (V.%1.1s)
  12586. #3    lelong    0x84500526            PCP archive
  12587. 3    belong    0x84500526            PCP archive
  12588. >7    byte    x                (V.%d)
  12589. #>20    lelong    -2                temporal index
  12590. #>20    lelong    -1                metadata
  12591. #>20    lelong    0                log volume #0
  12592. #>20    lelong    >0                log volume #%ld
  12593. >20    belong    -2                temporal index
  12594. >20    belong    -1                metadata
  12595. >20    belong    0                log volume #0
  12596. >20    belong    >0                log volume #%ld
  12597. >24    string    >\0                host: %s
  12598. 0    string    PCPFolio            PCP
  12599. >9    string    Version:            Archive Folio
  12600. >18    string    >\0                (V.%s)
  12601. 0    string    #pmchart            PCP pmchart view
  12602. >9    string    Version
  12603. >17    string    >\0                (V%-3.3s)
  12604. 0    string    #kmchart            PCP kmchart view
  12605. >9    string    Version
  12606. >17    string    >\0                (V.%s)
  12607. 0    string    pmview                PCP pmview config
  12608. >7    string    Version
  12609. >15    string    >\0                (V%-3.3s)
  12610. 0    string    #pmlogger            PCP pmlogger config
  12611. >10    string    Version
  12612. >18    string    >\0                (V%1.1s)
  12613. 0    string    #pmdahotproc            PCP pmdahotproc config
  12614. >13    string    Version
  12615. >21    string    >\0                (V%-3.3s)
  12616. 0    string    PcPh                PCP Help
  12617. >4    string    1                Index
  12618. >4    string    2                Text
  12619. >5    string    >\0                (V.%1.1s)
  12620. 0    string    #pmieconf-rules            PCP pmieconf rules
  12621. >16    string    >\0                (V.%1.1s)
  12622. 3    string    pmieconf-pmie            PCP pmie config
  12623. >17    string    >\0                (V.%1.1s)
  12624.  
  12625. # SpeedShop data files
  12626. 0    lelong    0x13130303            SpeedShop data file
  12627.  
  12628. # mdbm files
  12629. 0    lelong    0x01023962            mdbm file, version 0 (obsolete)
  12630. 0    string    mdbm                mdbm file,
  12631. >5    byte    x                version %d,
  12632. >6    byte    x                2^%d pages,
  12633. >7    byte    x                pagesize 2^%d,
  12634. >17    byte    x                hash %d,
  12635. >11    byte    x                dataformat %d
  12636.  
  12637. # Alias Maya files
  12638. 0    string    //Maya ASCII    Alias Maya Ascii File,
  12639. >13    string    >\0    version %s
  12640. 8    string    MAYAFOR4    Alias Maya Binary File,
  12641. >32    string    >\0    version %s scene
  12642. 8    string    MayaFOR4    Alias Maya Binary File,
  12643. >32    string    >\0    version %s scene
  12644. 8    string    CIMG        Alias Maya Image File
  12645. 8    string    DEEP        Alias Maya Image File
  12646. #------------------------------------------------------------------------------
  12647. # Type:    SVG Vectorial Graphics
  12648. # From:    Noel Torres <tecnico@ejerciciosresueltos.com>
  12649. 0    string        \<?xml\ version="
  12650. >15    string        >\0
  12651. >>23    search/400    \<svg            SVG Scalable Vector Graphics image
  12652. !:mime    image/svg+xml
  12653. >>23    search/400    \<gnc-v2        GnuCash file
  12654. !:mime    application/x-gnucash
  12655.  
  12656. # Sitemap file
  12657. 0    string        \<?xml\ version="
  12658. >15    string        >\0
  12659. >>23    search/400    \<urlset        XML Sitemap document text
  12660. !:mime    application/xml-sitemap
  12661.  
  12662. #------------------------------------------------------------------------------
  12663. # sgml:  file(1) magic for Standard Generalized Markup Language
  12664. # HyperText Markup Language (HTML) is an SGML document type,
  12665. # from Daniel Quinlan (quinlan@yggdrasil.com)
  12666. # adapted to string extenstions by Anthon van der Neut <anthon@mnt.org)
  12667. 0    search/1/cB    \<!doctype\ html    HTML document text
  12668. !:mime    text/html
  12669. 0    search/1/cb    \<head            HTML document text
  12670. !:mime    text/html
  12671. 0    search/1/cb    \<title            HTML document text
  12672. !:mime    text/html
  12673. 0    search/1/cb    \<html            HTML document text
  12674. !:mime    text/html
  12675.  
  12676. # Extensible markup language (XML), a subset of SGML
  12677. # from Marc Prud'hommeaux (marc@apocalypse.org)
  12678. 0    search/1/cb    \<?xml            XML document text
  12679. !:mime    application/xml
  12680. 0    string        \<?xml\ version\ "    XML
  12681. !:mime    application/xml
  12682. 0    string        \<?xml\ version="    XML
  12683. !:mime    application/xml
  12684. >15    search/1    >\0            %.3s document text
  12685. >>23    search/1    \<xsl:stylesheet    (XSL stylesheet)
  12686. >>24    search/1    \<xsl:stylesheet    (XSL stylesheet)
  12687. 0    string        \<?xml\ version='    XML
  12688. !:mime    application/xml
  12689. >15    search/1    >\0            %.3s document text
  12690. >>23    search/1    \<xsl:stylesheet    (XSL stylesheet)
  12691. >>24    search/1    \<xsl:stylesheet    (XSL stylesheet)
  12692. 0    search/1/b    \<?xml            XML document text
  12693. !:mime    application/xml
  12694. 0    search/1/b    \<?XML            broken XML document text
  12695. !:mime    application/xml
  12696.  
  12697.  
  12698. # SGML, mostly from rph@sq
  12699. 0    search/1/cb    \<!doctype        exported SGML document text
  12700. 0    search/1/cb    \<!subdoc        exported SGML subdocument text
  12701. 0    search/1/cb    \<!--            exported SGML document text
  12702.  
  12703. # Web browser cookie files
  12704. # (Mozilla, Galeon, Netscape 4, Konqueror..)
  12705. # Ulf Harnhammar <ulfh@update.uu.se>
  12706. 0    search/1    #\ HTTP\ Cookie\ File    Web browser cookie text
  12707. 0    search/1    #\ Netscape\ HTTP\ Cookie\ File    Netscape cookie text
  12708. 0    search/1    #\ KDE\ Cookie\ File    Konqueror cookie text
  12709.  
  12710. #------------------------------------------------------------------------
  12711. # file(1) magic for sharc files
  12712. #
  12713. # SHARC DSP, MIDI SysEx and RiscOS filetype definitions added by 
  12714. # FutureGroove Music (dsp@futuregroove.de)
  12715.  
  12716. #------------------------------------------------------------------------
  12717. #0    string            Draw        RiscOS Drawfile
  12718. #0    string            PACK        RiscOS PackdDir archive
  12719.  
  12720. #------------------------------------------------------------------------
  12721. # SHARC DSP stuff (based on the FGM SHARC DSP SDK)
  12722.  
  12723. #0    string            =!        Assembler source
  12724. #0    string            Analog        ADi asm listing file
  12725. 0    string            .SYSTEM        SHARC architecture file
  12726. 0    string            .system        SHARC architecture file
  12727.  
  12728. 0    leshort            0x521C        SHARC COFF binary
  12729. >2    leshort            >1        , %hd sections
  12730. >>12    lelong            >0        , not stripped
  12731.  
  12732. #------------------------------------------------------------------------------
  12733. # sinclair:  file(1) sinclair QL
  12734.  
  12735. # additions to /etc/magic by Thomas M. Ott (ThMO)
  12736.  
  12737. # Sinclair QL floppy disk formats (ThMO)
  12738. 0    string    =QL5        QL disk dump data,
  12739. >3    string    =A        720 KB,
  12740. >3    string    =B        1.44 MB,
  12741. >3    string    =C        3.2 MB,
  12742. >4    string    >\0        label:%.10s
  12743.  
  12744. # Sinclair QL OS dump (ThMO)
  12745. # (NOTE: if `file' would be able to use indirect references in a endian format
  12746. #     differing from the natural host format, this could be written more
  12747. #     reliably and faster...)
  12748. #
  12749. # we *can't* lookup QL OS code dumps, because `file' is UNABLE to read more
  12750. # than the first 8K of a file... #-(
  12751. #
  12752. #0        belong    =0x30000
  12753. #>49124        belong    <47104
  12754. #>>49128        belong    <47104
  12755. #>>>49132    belong    <47104
  12756. #>>>>49136    belong    <47104    QL OS dump data,
  12757. #>>>>>49148    string    >\0    type %.3s,
  12758. #>>>>>49142    string    >\0    version %.4s
  12759.  
  12760. # Sinclair QL firmware executables (ThMO)
  12761. 0    string    NqNqNq`\004    QL firmware executable (BCPL)
  12762.  
  12763. # Sinclair QL libraries (was ThMO)
  12764. 0    beshort    0xFB01        QDOS object
  12765. >2    pstring    x        '%s'
  12766.  
  12767. # Sinclair QL executables (was ThMO)
  12768. 4    belong    0x4AFB        QDOS executable
  12769. >9    pstring    x        '%s'
  12770.  
  12771. # Sinclair QL ROM (ThMO)
  12772. 0    belong    =0x4AFB0001    QL plugin-ROM data,
  12773. >9    pstring    =\0        un-named
  12774. >9    pstring    >\0        named: %s
  12775. # Type: SiSU Markup Language
  12776. # URL:  http://www.sisudoc.org/
  12777. # From: Ralph Amissah <ralph.amissah@gmail.com>
  12778.  
  12779. 0    regex    \^%?[\ \t]*SiSU[\ \t]+insert    SiSU text insert
  12780. >5    regex    [0-9.]+                %s
  12781.  
  12782. 0    regex    \^%[\ \t]+SiSU[\ \t]+master    SiSU text master
  12783. >5    regex    [0-9.]+                %s
  12784.  
  12785. 0    regex    \^%?[\ \t]*SiSU[\ \t]+text    SiSU text
  12786. >5    regex    [0-9.]+                %s
  12787.  
  12788. 0    regex    \^%?[\ \t]*SiSU[\ \t][0-9.]+    SiSU text
  12789. >5    regex    [0-9.]+                %s
  12790.  
  12791. 0    regex    \^%*[\ \t]*sisu-[0-9.]+        SiSU text
  12792. >5    regex    [0-9.]+                %s
  12793. #------------------------------------------------------------------------------
  12794. # Sketch Drawings: http://sketch.sourceforge.net/ 
  12795. # From: Edwin Mons <e@ik.nu>
  12796. 0    search/1    ##Sketch    Sketch document text
  12797.  
  12798. #-----------------------------------------------
  12799. # GNU Smalltalk image, starting at version 1.6.2
  12800. # From: catull_us@yahoo.com
  12801. #
  12802. 0    string    GSTIm\0\0    GNU SmallTalk
  12803. # little-endian
  12804. >7    byte&1    =0        LE image version
  12805. >>10    byte    x        %d.
  12806. >>9    byte    x        \b%d.
  12807. >>8    byte    x        \b%d
  12808. #>>12    lelong    x        , data: %ld
  12809. #>>16    lelong    x        , table: %ld
  12810. #>>20    lelong    x        , memory: %ld
  12811. # big-endian
  12812. >7    byte&1    =1        BE image version
  12813. >>8    byte    x        %d.
  12814. >>9    byte    x        \b%d.
  12815. >>10    byte    x        \b%d
  12816. #>>12    belong    x        , data: %ld
  12817. #>>16    belong    x        , table: %ld
  12818. #>>20    belong    x        , memory: %ld
  12819.  
  12820.  
  12821.  
  12822. #------------------------------------------------------------------------------
  12823. # sniffer:  file(1) magic for packet capture files
  12824. #
  12825. # From: guy@alum.mit.edu (Guy Harris)
  12826. #
  12827.  
  12828. #
  12829. # Microsoft Network Monitor 1.x capture files.
  12830. #
  12831. 0    string        RTSS        NetMon capture file
  12832. >5    byte        x        - version %d
  12833. >4    byte        x        \b.%d
  12834. >6    leshort        0        (Unknown)
  12835. >6    leshort        1        (Ethernet)
  12836. >6    leshort        2        (Token Ring)
  12837. >6    leshort        3        (FDDI)
  12838. >6    leshort        4        (ATM)
  12839.  
  12840. #
  12841. # Microsoft Network Monitor 2.x capture files.
  12842. #
  12843. 0    string        GMBU        NetMon capture file
  12844. >5    byte        x        - version %d
  12845. >4    byte        x        \b.%d
  12846. >6    leshort        0        (Unknown)
  12847. >6    leshort        1        (Ethernet)
  12848. >6    leshort        2        (Token Ring)
  12849. >6    leshort        3        (FDDI)
  12850. >6    leshort        4        (ATM)
  12851.  
  12852. #
  12853. # Network General Sniffer capture files.
  12854. # Sorry, make that "Network Associates Sniffer capture files."
  12855. # Sorry, make that "Network General old DOS Sniffer capture files."
  12856. #
  12857. 0    string        TRSNIFF\ data\ \ \ \ \032    Sniffer capture file
  12858. >33    byte        2        (compressed)
  12859. >23    leshort        x        - version %d
  12860. >25    leshort        x        \b.%d
  12861. >32    byte        0        (Token Ring)
  12862. >32    byte        1        (Ethernet)
  12863. >32    byte        2        (ARCNET)
  12864. >32    byte        3        (StarLAN)
  12865. >32    byte        4        (PC Network broadband)
  12866. >32    byte        5        (LocalTalk)
  12867. >32    byte        6        (Znet)
  12868. >32    byte        7        (Internetwork Analyzer)
  12869. >32    byte        9        (FDDI)
  12870. >32    byte        10        (ATM)
  12871.  
  12872. #
  12873. # Cinco Networks NetXRay capture files.
  12874. # Sorry, make that "Network General Sniffer Basic capture files."
  12875. # Sorry, make that "Network Associates Sniffer Basic capture files."
  12876. # Sorry, make that "Network Associates Sniffer Basic, and Windows
  12877. # Sniffer Pro", capture files."
  12878. # Sorry, make that "Network General Sniffer capture files."
  12879. #
  12880. 0    string        XCP\0        NetXRay capture file
  12881. >4    string        >\0        - version %s
  12882. >44    leshort        0        (Ethernet)
  12883. >44    leshort        1        (Token Ring)
  12884. >44    leshort        2        (FDDI)
  12885. >44    leshort        3        (WAN)
  12886. >44    leshort        8        (ATM)
  12887. >44    leshort        9        (802.11)
  12888.  
  12889. #
  12890. # "libpcap" capture files.
  12891. # (We call them "tcpdump capture file(s)" for now, as "tcpdump" is
  12892. # the main program that uses that format, but there are other programs
  12893. # that use "libpcap", or that use the same capture file format.)
  12894. #
  12895. 0    ubelong        0xa1b2c3d4    tcpdump capture file (big-endian)
  12896. >4    beshort        x        - version %d
  12897. >6    beshort        x        \b.%d
  12898. >20    belong        0        (No link-layer encapsulation
  12899. >20    belong        1        (Ethernet
  12900. >20    belong        2        (3Mb Ethernet
  12901. >20    belong        3        (AX.25
  12902. >20    belong        4        (ProNET
  12903. >20    belong        5        (CHAOS
  12904. >20    belong        6        (Token Ring
  12905. >20    belong        7        (BSD ARCNET
  12906. >20    belong        8        (SLIP
  12907. >20    belong        9        (PPP
  12908. >20    belong        10        (FDDI
  12909. >20    belong        11        (RFC 1483 ATM
  12910. >20    belong        12        (raw IP
  12911. >20    belong        13        (BSD/OS SLIP
  12912. >20    belong        14        (BSD/OS PPP
  12913. >20    belong        19        (Linux ATM Classical IP
  12914. >20    belong        50        (PPP or Cisco HDLC
  12915. >20    belong        51        (PPP-over-Ethernet
  12916. >20    belong        99        (Symantec Enterprise Firewall
  12917. >20    belong        100        (RFC 1483 ATM
  12918. >20    belong        101        (raw IP
  12919. >20    belong        102        (BSD/OS SLIP
  12920. >20    belong        103        (BSD/OS PPP
  12921. >20    belong        104        (BSD/OS Cisco HDLC
  12922. >20    belong        105        (802.11
  12923. >20    belong        106        (Linux Classical IP over ATM
  12924. >20    belong        107        (Frame Relay
  12925. >20    belong        108        (OpenBSD loopback
  12926. >20    belong        109        (OpenBSD IPsec encrypted
  12927. >20    belong        112        (Cisco HDLC
  12928. >20    belong        113        (Linux "cooked"
  12929. >20    belong        114        (LocalTalk
  12930. >20    belong        117        (OpenBSD PFLOG
  12931. >20    belong        119        (802.11 with Prism header
  12932. >20    belong        122        (RFC 2625 IP over Fibre Channel
  12933. >20    belong        123        (SunATM
  12934. >20    belong        127        (802.11 with radiotap header
  12935. >20    belong        129        (Linux ARCNET
  12936. >20    belong        138        (Apple IP over IEEE 1394
  12937. >20    belong        140        (MTP2
  12938. >20    belong        141        (MTP3
  12939. >20    belong        143        (DOCSIS
  12940. >20    belong        144        (IrDA
  12941. >20    belong        147        (Private use 0
  12942. >20    belong        148        (Private use 1
  12943. >20    belong        149        (Private use 2
  12944. >20    belong        150        (Private use 3
  12945. >20    belong        151        (Private use 4
  12946. >20    belong        152        (Private use 5
  12947. >20    belong        153        (Private use 6
  12948. >20    belong        154        (Private use 7
  12949. >20    belong        155        (Private use 8
  12950. >20    belong        156        (Private use 9
  12951. >20    belong        157        (Private use 10
  12952. >20    belong        158        (Private use 11
  12953. >20    belong        159        (Private use 12
  12954. >20    belong        160        (Private use 13
  12955. >20    belong        161        (Private use 14
  12956. >20    belong        162        (Private use 15
  12957. >20    belong        163        (802.11 with AVS header
  12958. >16    belong        x        \b, capture length %d)
  12959. 0    ulelong        0xa1b2c3d4    tcpdump capture file (little-endian)
  12960. >4    leshort        x        - version %d
  12961. >6    leshort        x        \b.%d
  12962. >20    lelong        0        (No link-layer encapsulation
  12963. >20    lelong        1        (Ethernet
  12964. >20    lelong        2        (3Mb Ethernet
  12965. >20    lelong        3        (AX.25
  12966. >20    lelong        4        (ProNET
  12967. >20    lelong        5        (CHAOS
  12968. >20    lelong        6        (Token Ring
  12969. >20    lelong        7        (ARCNET
  12970. >20    lelong        8        (SLIP
  12971. >20    lelong        9        (PPP
  12972. >20    lelong        10        (FDDI
  12973. >20    lelong        11        (RFC 1483 ATM
  12974. >20    lelong        12        (raw IP
  12975. >20    lelong        13        (BSD/OS SLIP
  12976. >20    lelong        14        (BSD/OS PPP
  12977. >20    lelong        19        (Linux ATM Classical IP
  12978. >20    lelong        50        (PPP or Cisco HDLC
  12979. >20    lelong        51        (PPP-over-Ethernet
  12980. >20    lelong        99        (Symantec Enterprise Firewall
  12981. >20    lelong        100        (RFC 1483 ATM
  12982. >20    lelong        101        (raw IP
  12983. >20    lelong        102        (BSD/OS SLIP
  12984. >20    lelong        103        (BSD/OS PPP
  12985. >20    lelong        104        (BSD/OS Cisco HDLC
  12986. >20    lelong        105        (802.11
  12987. >20    lelong        106        (Linux Classical IP over ATM
  12988. >20    lelong        107        (Frame Relay
  12989. >20    lelong        108        (OpenBSD loopback
  12990. >20    lelong        109        (OpenBSD IPsec encrypted
  12991. >20    lelong        112        (Cisco HDLC
  12992. >20    lelong        113        (Linux "cooked"
  12993. >20    lelong        114        (LocalTalk
  12994. >20    lelong        117        (OpenBSD PFLOG
  12995. >20    lelong        119        (802.11 with Prism header
  12996. >20    lelong        122        (RFC 2625 IP over Fibre Channel
  12997. >20    lelong        123        (SunATM
  12998. >20    lelong        127        (802.11 with radiotap header
  12999. >20    lelong        129        (Linux ARCNET
  13000. >20    lelong        138        (Apple IP over IEEE 1394
  13001. >20    lelong        140        (MTP2
  13002. >20    lelong        141        (MTP3
  13003. >20    lelong        143        (DOCSIS
  13004. >20    lelong        144        (IrDA
  13005. >20    lelong        147        (Private use 0
  13006. >20    lelong        148        (Private use 1
  13007. >20    lelong        149        (Private use 2
  13008. >20    lelong        150        (Private use 3
  13009. >20    lelong        151        (Private use 4
  13010. >20    lelong        152        (Private use 5
  13011. >20    lelong        153        (Private use 6
  13012. >20    lelong        154        (Private use 7
  13013. >20    lelong        155        (Private use 8
  13014. >20    lelong        156        (Private use 9
  13015. >20    lelong        157        (Private use 10
  13016. >20    lelong        158        (Private use 11
  13017. >20    lelong        159        (Private use 12
  13018. >20    lelong        160        (Private use 13
  13019. >20    lelong        161        (Private use 14
  13020. >20    lelong        162        (Private use 15
  13021. >20    lelong        163        (802.11 with AVS header
  13022. >16    lelong        x        \b, capture length %d)
  13023.  
  13024. #
  13025. # "libpcap"-with-Alexey-Kuznetsov's-patches capture files.
  13026. # (We call them "tcpdump capture file(s)" for now, as "tcpdump" is
  13027. # the main program that uses that format, but there are other programs
  13028. # that use "libpcap", or that use the same capture file format.)
  13029. #
  13030. 0    ubelong        0xa1b2cd34    extended tcpdump capture file (big-endian)
  13031. >4    beshort        x        - version %d
  13032. >6    beshort        x        \b.%d
  13033. >20    belong        0        (No link-layer encapsulation
  13034. >20    belong        1        (Ethernet
  13035. >20    belong        2        (3Mb Ethernet
  13036. >20    belong        3        (AX.25
  13037. >20    belong        4        (ProNET
  13038. >20    belong        5        (CHAOS
  13039. >20    belong        6        (Token Ring
  13040. >20    belong        7        (ARCNET
  13041. >20    belong        8        (SLIP
  13042. >20    belong        9        (PPP
  13043. >20    belong        10        (FDDI
  13044. >20    belong        11        (RFC 1483 ATM
  13045. >20    belong        12        (raw IP
  13046. >20    belong        13        (BSD/OS SLIP
  13047. >20    belong        14        (BSD/OS PPP
  13048. >16    belong        x        \b, capture length %d)
  13049. 0    ulelong        0xa1b2cd34    extended tcpdump capture file (little-endian)
  13050. >4    leshort        x        - version %d
  13051. >6    leshort        x        \b.%d
  13052. >20    lelong        0        (No link-layer encapsulation
  13053. >20    lelong        1        (Ethernet
  13054. >20    lelong        2        (3Mb Ethernet
  13055. >20    lelong        3        (AX.25
  13056. >20    lelong        4        (ProNET
  13057. >20    lelong        5        (CHAOS
  13058. >20    lelong        6        (Token Ring
  13059. >20    lelong        7        (ARCNET
  13060. >20    lelong        8        (SLIP
  13061. >20    lelong        9        (PPP
  13062. >20    lelong        10        (FDDI
  13063. >20    lelong        11        (RFC 1483 ATM
  13064. >20    lelong        12        (raw IP
  13065. >20    lelong        13        (BSD/OS SLIP
  13066. >20    lelong        14        (BSD/OS PPP
  13067. >16    lelong        x        \b, capture length %d)
  13068.  
  13069. #
  13070. # AIX "iptrace" capture files.
  13071. #
  13072. 0    string        iptrace\ 1.0    "iptrace" capture file
  13073. 0    string        iptrace\ 2.0    "iptrace" capture file
  13074.  
  13075. #
  13076. # Novell LANalyzer capture files.
  13077. #
  13078. 0    leshort        0x1001        LANalyzer capture file
  13079. 0    leshort        0x1007        LANalyzer capture file
  13080.  
  13081. #
  13082. # HP-UX "nettl" capture files.
  13083. #
  13084. 0    string        \x54\x52\x00\x64\x00    "nettl" capture file
  13085.  
  13086. #
  13087. # RADCOM WAN/LAN Analyzer capture files.
  13088. #
  13089. 0    string        \x42\xd2\x00\x34\x12\x66\x22\x88    RADCOM WAN/LAN Analyzer capture file
  13090.  
  13091. #
  13092. # NetStumbler log files.  Not really packets, per se, but about as
  13093. # close as you can get.  These are log files from NetStumbler, a
  13094. # Windows program, that scans for 802.11b networks.
  13095. #
  13096. 0    string        NetS        NetStumbler log file
  13097. >8    lelong        x        \b, %d stations found
  13098.  
  13099. #
  13100. # EtherPeek/AiroPeek "version 9" capture files.
  13101. #
  13102. 0    string        \177ver        EtherPeek/AiroPeek capture file
  13103.  
  13104. #
  13105. # Visual Networks traffic capture files.
  13106. #
  13107. 0    string        \x05VNF        Visual Networks traffic capture file
  13108.  
  13109. #
  13110. # Network Instruments Observer capture files.
  13111. #
  13112. 0    string        ObserverPktBuffe    Network Instruments Observer capture file
  13113.  
  13114. #
  13115. # Files from Accellent Group's 5View products.
  13116. #
  13117. 0    string        \xaa\xaa\xaa\xaa    5View capture file
  13118. #------------------------------------------------------------------------------
  13119. # softquad:  file(1) magic for SoftQuad Publishing Software
  13120. #
  13121. # Author/Editor and RulesBuilder
  13122. #
  13123. # XXX - byte order?
  13124. #
  13125. 0    string        \<!SQ\ DTD>    Compiled SGML rules file
  13126. >9    string        >\0         Type %s
  13127. 0    string        \<!SQ\ A/E>    A/E SGML Document binary
  13128. >9    string        >\0         Type %s
  13129. 0    string        \<!SQ\ STS>    A/E SGML binary styles file
  13130. >9    string        >\0         Type %s
  13131. 0    short        0xc0de        Compiled PSI (v1) data
  13132. 0    short        0xc0da        Compiled PSI (v2) data
  13133. >3    string        >\0        (%s)
  13134. # Binary sqtroff font/desc files...
  13135. 0    short        0125252        SoftQuad DESC or font file binary
  13136. >2    short        >0        - version %d
  13137. # Bitmaps...
  13138. 0    search/1    SQ\ BITMAP1    SoftQuad Raster Format text
  13139. #0    string        SQ\ BITMAP2    SoftQuad Raster Format data
  13140. # sqtroff intermediate language (replacement for ditroff int. lang.)
  13141. 0    string        X\         SoftQuad troff Context intermediate
  13142. >2    string        495        for AT&T 495 laser printer
  13143. >2    string        hp        for Hewlett-Packard LaserJet
  13144. >2    string        impr        for IMAGEN imPRESS
  13145. >2    string        ps        for PostScript
  13146.  
  13147. # From: Michael Piefel <piefel@debian.org>
  13148. # sqtroff intermediate language (replacement for ditroff int. lang.)
  13149. 0    string        X\ 495        SoftQuad troff Context intermediate for AT&T 495 laser printer
  13150. 0    string        X\ hp        SoftQuad troff Context intermediate for HP LaserJet
  13151. 0    string        X\ impr        SoftQuad troff Context intermediate for IMAGEN imPRESS
  13152. 0    string        X\ ps        SoftQuad troff Context intermediate for PostScript
  13153.  
  13154. #------------------------------------------------------------------------------
  13155. # spec:  file(1) magic for SPEC raw results (*.raw, *.rsf)
  13156. #
  13157. # Cloyce D. Spradling <cloyce@headgear.org>
  13158.  
  13159. 0    string    spec            SPEC
  13160. >4    string    .cpu            CPU
  13161. >>8    string    <:            \b%.4s
  13162. >>12    string    .            raw result text
  13163.  
  13164. 17    string    version=SPECjbb        SPECjbb
  13165. >32    string    <:            \b%.4s
  13166. >>37    string    <:            v%.4s raw result text
  13167.  
  13168. 0    string    BEGIN\040SPECWEB    SPECweb
  13169. >13    string    <:            \b%.2s
  13170. >>15    string    _SSL            \b_SSL
  13171. >>>20    string    <:            v%.4s raw result text
  13172. >>16    string    <:            v%.4s raw result text
  13173.  
  13174. #------------------------------------------------------------------------------
  13175. # spectrum:  file(1) magic for Spectrum emulator files.
  13176. #
  13177. # John Elliott <jce@seasip.demon.co.uk>
  13178.  
  13179. #
  13180. # Spectrum +3DOS header
  13181. #
  13182. 0       string          PLUS3DOS\032    Spectrum +3 data
  13183. >15     byte            0               - BASIC program
  13184. >15     byte            1               - number array
  13185. >15     byte            2               - character array
  13186. >15     byte            3               - memory block
  13187. >>16    belong          0x001B0040      (screen)
  13188. >15     byte            4               - Tasword document
  13189. >15     string          TAPEFILE        - ZXT tapefile
  13190. #
  13191. # Tape file. This assumes the .TAP starts with a Spectrum-format header,
  13192. # which nearly all will.
  13193. #
  13194. 0       string          \023\000\000    Spectrum .TAP data
  13195. >4      string          x               "%-10.10s"
  13196. >3      byte            0               - BASIC program
  13197. >3      byte            1               - number array
  13198. >3      byte            2               - character array
  13199. >3      byte            3               - memory block
  13200. >>14    belong          0x001B0040      (screen)
  13201.  
  13202. # The following three blocks are from pak21-spectrum@srcf.ucam.org
  13203. # TZX tape images
  13204. 0      string          ZXTape!\x1a     Spectrum .TZX data
  13205. >8     byte            x               version %d
  13206. >9     byte            x               \b.%d
  13207.  
  13208. # RZX input recording files
  13209. 0      string          RZX!            Spectrum .RZX data
  13210. >4     byte            x               version %d
  13211. >5     byte            x               \b.%d
  13212.  
  13213. # Floppy disk images
  13214. 0      string          MV\ -\ CPCEMU\ Disk-Fil Amstrad/Spectrum .DSK data
  13215. 0      string          MV\ -\ CPC\ format\ Dis Amstrad/Spectrum DU54 .DSK data
  13216. 0      string          EXTENDED\ CPC\ DSK\ Fil Amstrad/Spectrum Extended .DSK data
  13217. 0      string          SINCLAIR        Spectrum .SCL Betadisk image
  13218.  
  13219. # Hard disk images
  13220. 0      string          RS-IDE\x1a      Spectrum .HDF hard disk image
  13221. >7     byte            x               \b, version 0x%02x
  13222.  
  13223. #------------------------------------------------------------------------------
  13224. # sql:  file(1) magic for SQL files
  13225. #
  13226. # From: "Marty Leisner" <mleisner@eng.mc.xerox.com>
  13227. # Recognize some MySQL files.
  13228. #
  13229. 0    beshort            0xfe01        MySQL table definition file
  13230. >2    byte            x        Version %d
  13231. 0    belong&0xffffff00    0xfefe0300    MySQL MISAM index file
  13232. >3    byte            x        Version %d
  13233. 0    belong&0xffffff00    0xfefe0700    MySQL MISAM compressed data file
  13234. >3    byte            x        Version %d
  13235. 0    belong&0xffffff00    0xfefe0500    MySQL ISAM index file
  13236. >3    byte            x        Version %d
  13237. 0    belong&0xffffff00    0xfefe0600    MySQL ISAM compressed data file
  13238. >3    byte            x        Version %d
  13239. 0    string             \376bin        MySQL replication log
  13240.  
  13241. #------------------------------------------------------------------------------
  13242. # iRiver H Series database file 
  13243. # From Ken Guest <ken@linux.ie>
  13244. # As observed from iRivNavi.iDB and unencoded firmware
  13245. #
  13246. 0   string        iRivDB    iRiver Database file
  13247. >11  string    >\0    Version %s
  13248. >39  string        iHP-100    [H Series]
  13249.  
  13250. #------------------------------------------------------------------------------
  13251. # SQLite database files
  13252. # Ken Guest <ken@linux.ie>, Ty Sarna, Zack Weinberg
  13253. #
  13254. # Version 1 used GDBM internally; its files cannot be distinguished
  13255. # from other GDBM files.
  13256. #
  13257. # Version 2 used this format:
  13258. 0    string    **\ This\ file\ contains\ an\ SQLite  SQLite 2.x database
  13259.  
  13260. # Version 3 of SQLite allows applications to embed their own "user version"
  13261. # number in the database.  Detect this and distinguish those files.
  13262.  
  13263. 0   string  SQLite\ format\ 3
  13264. >60 string  _MTN               Monotone source repository
  13265. >60 belong  !0                 SQLite 3.x database, user version %u
  13266. >60 belong  0                  SQLite 3.x database
  13267.  
  13268. #------------------------------------------------------------------------------
  13269. # sun:  file(1) magic for Sun machines
  13270. #
  13271. # Values for big-endian Sun (MC680x0, SPARC) binaries on pre-5.x
  13272. # releases.  (5.x uses ELF.)
  13273. #
  13274. 0    belong&077777777    0600413        sparc demand paged
  13275. >0    byte        &0x80
  13276. >>20    belong        <4096        shared library
  13277. >>20    belong        =4096        dynamically linked executable
  13278. >>20    belong        >4096        dynamically linked executable
  13279. >0    byte        ^0x80        executable
  13280. >16    belong        >0        not stripped
  13281.  
  13282. 0    belong&077777777    0600410        sparc pure
  13283. >0    byte        &0x80        dynamically linked executable
  13284. >0    byte        ^0x80        executable
  13285. >16    belong        >0        not stripped
  13286.  
  13287. 0    belong&077777777    0600407        sparc
  13288. >0    byte        &0x80        dynamically linked executable
  13289. >0    byte        ^0x80        executable
  13290. >16    belong        >0        not stripped
  13291.  
  13292. 0    belong&077777777    0400413        mc68020 demand paged
  13293. >0    byte        &0x80
  13294. >>20    belong        <4096        shared library
  13295. >>20    belong        =4096        dynamically linked executable
  13296. >>20    belong        >4096        dynamically linked executable
  13297. >0    byte        ^0x80        executable
  13298. >16    belong        >0        not stripped
  13299.  
  13300. 0    belong&077777777    0400410        mc68020 pure
  13301. >0    byte        &0x80        dynamically linked executable
  13302. >0    byte        ^0x80        executable
  13303. >16    belong        >0        not stripped
  13304.  
  13305. 0    belong&077777777    0400407        mc68020
  13306. >0    byte        &0x80        dynamically linked executable
  13307. >0    byte        ^0x80        executable
  13308. >16    belong        >0        not stripped
  13309.  
  13310. 0    belong&077777777    0200413        mc68010 demand paged
  13311. >0    byte        &0x80
  13312. >>20    belong        <4096        shared library
  13313. >>20    belong        =4096        dynamically linked executable
  13314. >>20    belong        >4096        dynamically linked executable
  13315. >0    byte        ^0x80        executable
  13316. >16    belong        >0        not stripped
  13317.  
  13318. 0    belong&077777777    0200410        mc68010 pure
  13319. >0    byte        &0x80        dynamically linked executable
  13320. >0    byte        ^0x80        executable
  13321. >16    belong        >0        not stripped
  13322.  
  13323. 0    belong&077777777    0200407        mc68010
  13324. >0    byte        &0x80        dynamically linked executable
  13325. >0    byte        ^0x80        executable
  13326. >16    belong        >0        not stripped
  13327.  
  13328. # reworked these to avoid anything beginning with zero becoming "old sun-2"
  13329. 0    belong        0407        old sun-2 executable
  13330. >16    belong        >0        not stripped
  13331. 0    belong        0410        old sun-2 pure executable
  13332. >16    belong        >0        not stripped
  13333. 0    belong        0413        old sun-2 demand paged executable
  13334. >16    belong        >0        not stripped
  13335.  
  13336. #
  13337. # Core files.  "SPARC 4.x BCP" means "core file from a SunOS 4.x SPARC
  13338. # binary executed in compatibility mode under SunOS 5.x".
  13339. #
  13340. 0    belong        0x080456    SunOS core file
  13341. >4    belong        432        (SPARC)
  13342. >>132    string        >\0        from '%s'
  13343. >>116    belong        =3        (quit)
  13344. >>116    belong        =4        (illegal instruction)
  13345. >>116    belong        =5        (trace trap)
  13346. >>116    belong        =6        (abort)
  13347. >>116    belong        =7        (emulator trap)
  13348. >>116    belong        =8        (arithmetic exception)
  13349. >>116    belong        =9        (kill)
  13350. >>116    belong        =10        (bus error)
  13351. >>116    belong        =11        (segmentation violation)
  13352. >>116    belong        =12        (bad argument to system call)
  13353. >>116    belong        =29        (resource lost)
  13354. >>120    belong        x        (T=%dK,
  13355. >>124    belong        x        D=%dK,
  13356. >>128    belong        x        S=%dK)
  13357. >4    belong        826        (68K)
  13358. >>128    string        >\0        from '%s'
  13359. >4    belong        456        (SPARC 4.x BCP)
  13360. >>152    string        >\0        from '%s'
  13361. # Sun SunPC
  13362. 0    long        0xfa33c08e    SunPC 4.0 Hard Disk
  13363. 0    string        #SUNPC_CONFIG    SunPC 4.0 Properties Values
  13364. # Sun snoop (see RFC 1761, which describes the capture file format).
  13365. #
  13366. 0    string        snoop        Snoop capture file
  13367. >8    belong        >0        - version %ld
  13368. >12    belong        0        (IEEE 802.3)
  13369. >12    belong        1        (IEEE 802.4)
  13370. >12    belong        2        (IEEE 802.5)
  13371. >12    belong        3        (IEEE 802.6)
  13372. >12    belong        4        (Ethernet)
  13373. >12    belong        5        (HDLC)
  13374. >12    belong        6        (Character synchronous)
  13375. >12    belong        7        (IBM channel-to-channel adapter)
  13376. >12    belong        8        (FDDI)
  13377. >12    belong        9        (Unknown)
  13378.  
  13379. # Microsoft ICM color profile
  13380. 36    string        acspMSFT    Microsoft ICM Color Profile
  13381. # Sun KCMS
  13382. 36    string        acsp        Kodak Color Management System, ICC Profile
  13383.  
  13384. #---------------------------------------------------------------------------
  13385. # The following entries have been tested by Duncan Laurie <duncan@sun.com> (a
  13386. # lead Sun/Cobalt developer) who agrees that they are good and worthy of
  13387. # inclusion.
  13388.  
  13389. # Boot ROM images for Sun/Cobalt Linux server appliances
  13390. 0       string  Cobalt\ Networks\ Inc.\nFirmware\ v     Paged COBALT boot rom
  13391. >38     string x        V%.4s
  13392.  
  13393. # New format for Sun/Cobalt boot ROMs is annoying, it stores the version code
  13394. # at the very end where file(1) can't get it.
  13395. 0       string CRfs     COBALT boot rom data (Flat boot rom or file system)
  13396.  
  13397.  
  13398. #------------------------------------------------------------------------
  13399. # sysex: file(1) magic for MIDI sysex files
  13400. #
  13401. 0    byte            0xF0        SysEx File -
  13402.  
  13403. # North American Group
  13404. >1    byte            0x01        Sequential
  13405. >1    byte            0x02        IDP
  13406. >1    byte            0x03        OctavePlateau
  13407. >1    byte            0x04        Moog
  13408. >1    byte            0x05        Passport
  13409. >1    byte            0x06        Lexicon
  13410. >1    byte            0x07        Kurzweil/Future Retro
  13411. >>3    byte            0x77        777
  13412. >>4    byte            0x00        Bank
  13413. >>4    byte            0x01        Song
  13414. >>5    byte            0x0f        16
  13415. >>5    byte            0x0e        15
  13416. >>5    byte            0x0d        14
  13417. >>5    byte            0x0c        13
  13418. >>5    byte            0x0b        12
  13419. >>5    byte            0x0a        11
  13420. >>5    byte            0x09        10
  13421. >>5    byte            0x08        9
  13422. >>5    byte            0x07        8
  13423. >>5    byte            0x06        7
  13424. >>5    byte            0x05        6
  13425. >>5    byte            0x04        5
  13426. >>5    byte            0x03        4
  13427. >>5    byte            0x02        3
  13428. >>5    byte            0x01        2
  13429. >>5    byte            0x00        1
  13430. >>5    byte            0x10        (ALL)
  13431. >>2    byte            x            \b, Channel %d
  13432. >1    byte            0x08        Fender
  13433. >1    byte            0x09        Gulbransen
  13434. >1    byte            0x0a        AKG
  13435. >1    byte            0x0b        Voyce
  13436. >1    byte            0x0c        Waveframe
  13437. >1    byte            0x0d        ADA
  13438. >1    byte            0x0e        Garfield
  13439. >1    byte            0x0f        Ensoniq
  13440. >1    byte            0x10        Oberheim
  13441. >>2    byte            0x06        Matrix 6 series
  13442. >>3    byte            0x0A        Dump (All)
  13443. >>3    byte            0x01        Dump (Bank)
  13444. >>4 belong            0x0002040E        Matrix 1000
  13445. >>>11 byte            <2            User bank %d
  13446. >>>11 byte            >1            Preset bank %d
  13447. >1    byte            0x11        Apple
  13448. >1    byte            0x12        GreyMatter
  13449. >1    byte            0x14        PalmTree
  13450. >1    byte            0x15        JLCooper
  13451. >1    byte            0x16        Lowrey
  13452. >1    byte            0x17        AdamsSmith
  13453. >1    byte            0x18        E-mu
  13454. >1    byte            0x19        Harmony
  13455. >1    byte            0x1a        ART
  13456. >1    byte            0x1b        Baldwin
  13457. >1    byte            0x1c        Eventide
  13458. >1    byte            0x1d        Inventronics
  13459. >1    byte            0x1f        Clarity
  13460.  
  13461. # European Group
  13462. >1    byte            0x21        SIEL
  13463. >1    byte            0x22        Synthaxe
  13464. >1    byte            0x24        Hohner
  13465. >1    byte            0x25        Twister
  13466. >1    byte            0x26        Solton
  13467. >1    byte            0x27        Jellinghaus
  13468. >1    byte            0x28        Southworth
  13469. >1    byte            0x29        PPG
  13470. >1    byte            0x2a        JEN
  13471. >1    byte            0x2b        SSL
  13472. >1    byte            0x2c        AudioVertrieb
  13473.  
  13474. >1    byte            0x2f        ELKA
  13475. >>3    byte            0x09        EK-44
  13476.  
  13477. >1    byte            0x30        Dynacord
  13478. >1    byte            0x31        Jomox
  13479. >1    byte            0x33        Clavia
  13480. >1    byte            0x39        Soundcraft
  13481. # Some Waldorf info from http://Stromeko.Synth.net/Downloads#WaldorfDocs
  13482. >1    byte            0x3e        Waldorf
  13483. >>2    byte            0x00        microWave
  13484. >>2    byte            0x0E        microwave2 / XT
  13485. >>2    byte            0x0F        Q / Q+
  13486. >>3    byte            =0            (default id)
  13487. >>3 byte            >0            (
  13488. >>>3 byte            <0x7F        \bdevice %d)
  13489. >>>3 byte            =0x7F        \bbroadcast id)
  13490. >>3    byte            0x7f        Microwave I
  13491. >>>4    byte            0x00        SNDR (Sound Request)
  13492. >>>4    byte            0x10        SNDD (Sound Dump)
  13493. >>>4    byte            0x20        SNDP (Sound Parameter Change)
  13494. >>>4    byte            0x30        SNDQ (Sound Parameter Inquiry)
  13495. >>>4    byte            0x70        BOOT (Sound Reserved)
  13496. >>>4    byte            0x01        MULR (Multi Request)
  13497. >>>4    byte            0x11        MULD (Multi Dump)
  13498. >>>4    byte            0x21        MULP (Multi Parameter Change)
  13499. >>>4    byte            0x31        MULQ (Multi Parameter Inquiry)
  13500. >>>4    byte            0x71        OS (Multi Reserved)
  13501. >>>4    byte            0x02        DRMR (Drum Map Request)
  13502. >>>4    byte            0x12        DRMD (Drum Map Dump)
  13503. >>>4    byte            0x22        DRMP (Drum Map Parameter Change)
  13504. >>>4    byte            0x32        DRMQ (Drum Map Parameter Inquiry)
  13505. >>>4    byte            0x72        BIN (Drum Map Reserved)
  13506. >>>4    byte            0x03        PATR (Sequencer Pattern Request)
  13507. >>>4    byte            0x13        PATD (Sequencer Pattern Dump)
  13508. >>>4    byte            0x23        PATP (Sequencer Pattern Parameter Change)
  13509. >>>4    byte            0x33        PATQ (Sequencer Pattern Parameter Inquiry)
  13510. >>>4    byte            0x73        AFM (Sequencer Pattern Reserved)
  13511. >>>4    byte            0x04        GLBR (Global Parameter Request)
  13512. >>>4    byte            0x14        GLBD (Global Parameter Dump)
  13513. >>>4    byte            0x24        GLBP (Global Parameter Parameter Change)
  13514. >>>4    byte            0x34        GLBQ (Global Parameter Parameter Inquiry)
  13515. >>>4    byte            0x07        MODR (Mode Parameter Request)
  13516. >>>4    byte            0x17        MODD (Mode Parameter Dump)
  13517. >>>4    byte            0x27        MODP (Mode Parameter Parameter Change)
  13518. >>>4    byte            0x37        MODQ (Mode Parameter Parameter Inquiry)
  13519. >>2    byte            0x10        microQ
  13520. >>>4    byte            0x00        SNDR (Sound Request)
  13521. >>>4    byte            0x10        SNDD (Sound Dump)
  13522. >>>4    byte            0x20        SNDP (Sound Parameter Change)
  13523. >>>4    byte            0x30        SNDQ (Sound Parameter Inquiry)
  13524. >>>4    byte            0x70        (Sound Reserved)
  13525. >>>4    byte            0x01        MULR (Multi Request)
  13526. >>>4    byte            0x11        MULD (Multi Dump)
  13527. >>>4    byte            0x21        MULP (Multi Parameter Change)
  13528. >>>4    byte            0x31        MULQ (Multi Parameter Inquiry)
  13529. >>>4    byte            0x71        OS (Multi Reserved)
  13530. >>>4    byte            0x02        DRMR (Drum Map Request)
  13531. >>>4    byte            0x12        DRMD (Drum Map Dump)
  13532. >>>4    byte            0x22        DRMP (Drum Map Parameter Change)
  13533. >>>4    byte            0x32        DRMQ (Drum Map Parameter Inquiry)
  13534. >>>4    byte            0x72        BIN (Drum Map Reserved)
  13535. >>>4    byte            0x04        GLBR (Global Parameter Request)
  13536. >>>4    byte            0x14        GLBD (Global Parameter Dump)
  13537. >>>4    byte            0x24        GLBP (Global Parameter Parameter Change)
  13538. >>>4    byte            0x34        GLBQ (Global Parameter Parameter Inquiry)
  13539. >>2    byte            0x11        rackAttack
  13540. >>>4    byte            0x00        SNDR (Sound Parameter Request)
  13541. >>>4    byte            0x10        SNDD (Sound Parameter Dump)
  13542. >>>4    byte            0x20        SNDP (Sound Parameter Parameter Change)
  13543. >>>4    byte            0x30        SNDQ (Sound Parameter Parameter Inquiry)
  13544. >>>4    byte            0x01        PRGR (Program Parameter Request)
  13545. >>>4    byte            0x11        PRGD (Program Parameter Dump)
  13546. >>>4    byte            0x21        PRGP (Program Parameter Parameter Change)
  13547. >>>4    byte            0x31        PRGQ (Program Parameter Parameter Inquiry)
  13548. >>>4    byte            0x71        OS (Program Parameter Reserved)
  13549. >>>4    byte            0x03        PATR (Pattern Parameter Request)
  13550. >>>4    byte            0x13        PATD (Pattern Parameter Dump)
  13551. >>>4    byte            0x23        PATP (Pattern Parameter Parameter Change)
  13552. >>>4    byte            0x33        PATQ (Pattern Parameter Parameter Inquiry)
  13553. >>>4    byte            0x04        GLBR (Global Parameter Request)
  13554. >>>4    byte            0x14        GLBD (Global Parameter Dump)
  13555. >>>4    byte            0x24        GLBP (Global Parameter Parameter Change)
  13556. >>>4    byte            0x34        GLBQ (Global Parameter Parameter Inquiry)
  13557. >>>4    byte            0x05        EFXR (FX Parameter Request)
  13558. >>>4    byte            0x15        EFXD (FX Parameter Dump)
  13559. >>>4    byte            0x25        EFXP (FX Parameter Parameter Change)
  13560. >>>4    byte            0x35        EFXQ (FX Parameter Parameter Inquiry)
  13561. >>>4    byte            0x07        MODR (Mode Command Request)
  13562. >>>4    byte            0x17        MODD (Mode Command Dump)
  13563. >>>4    byte            0x27        MODP (Mode Command Parameter Change)
  13564. >>>4    byte            0x37        MODQ (Mode Command Parameter Inquiry)
  13565. >>2    byte            0x03        Wave
  13566. >>>4    byte            0x00        SBPR (Soundprogram)
  13567. >>>4    byte            0x01        SAPR (Performance)
  13568. >>>4    byte            0x02        SWAVE (Wave)
  13569. >>>4    byte            0x03        SWTBL (Wave control table)
  13570. >>>4    byte            0x04        SVT (Velocity Curve)
  13571. >>>4    byte            0x05        STT (Tuning Table)
  13572. >>>4    byte            0x06        SGLB (Global Parameters)
  13573. >>>4    byte            0x07        SARRMAP (Performance Program Change Map)
  13574. >>>4    byte            0x08        SBPRMAP (Sound Program Change Map)
  13575. >>>4    byte            0x09        SBPRPAR (Sound Parameter)
  13576. >>>4    byte            0x0A        SARRPAR (Performance Parameter)
  13577. >>>4    byte            0x0B        SINSPAR (Instrument/External Parameter)
  13578. >>>4    byte            0x0F        SBULK (Bulk Switch on/off)
  13579.  
  13580. # Japanese Group
  13581. >1    byte            0x40        Kawai
  13582. >>3    byte            0x20        K1
  13583. >>3    byte            0x22        K4
  13584.  
  13585. >1    byte            0x41        Roland
  13586. >>3    byte            0x14        D-50
  13587. >>3    byte            0x2b        U-220
  13588. >>3    byte            0x02        TR-707
  13589.  
  13590. >1    byte            0x42        Korg
  13591. >>3    byte            0x19        M1
  13592.  
  13593. >1    byte            0x43        Yamaha
  13594. >1    byte            0x44        Casio
  13595. >1    byte            0x46        Kamiya
  13596. >1    byte            0x47        Akai
  13597. >1    byte            0x48        Victor
  13598. >1    byte            0x49        Mesosha
  13599. >1    byte            0x4b        Fujitsu
  13600. >1    byte            0x4c        Sony
  13601. >1    byte            0x4e        Teac
  13602. >1    byte            0x50        Matsushita
  13603. >1    byte            0x51        Fostex
  13604. >1    byte            0x52        Zoom
  13605. >1    byte            0x54        Matsushita
  13606. >1    byte            0x57        Acoustic tech. lab.
  13607.  
  13608. >1    belong&0xffffff00    0x00007400    Ta Horng
  13609. >1    belong&0xffffff00    0x00007500    e-Tek
  13610. >1    belong&0xffffff00    0x00007600    E-Voice
  13611. >1    belong&0xffffff00    0x00007700    Midisoft
  13612. >1    belong&0xffffff00    0x00007800    Q-Sound
  13613. >1    belong&0xffffff00    0x00007900    Westrex
  13614. >1    belong&0xffffff00    0x00007a00    Nvidia*
  13615. >1    belong&0xffffff00    0x00007b00    ESS
  13616. >1    belong&0xffffff00    0x00007c00    Mediatrix
  13617. >1    belong&0xffffff00    0x00007d00    Brooktree
  13618. >1    belong&0xffffff00    0x00007e00    Otari
  13619. >1    belong&0xffffff00    0x00007f00    Key Electronics
  13620. >1    belong&0xffffff00    0x00010000    Shure
  13621. >1    belong&0xffffff00    0x00010100    AuraSound
  13622. >1    belong&0xffffff00    0x00010200    Crystal
  13623. >1    belong&0xffffff00    0x00010300    Rockwell
  13624. >1    belong&0xffffff00    0x00010400    Silicon Graphics
  13625. >1    belong&0xffffff00    0x00010500    Midiman
  13626. >1    belong&0xffffff00    0x00010600    PreSonus
  13627. >1    belong&0xffffff00    0x00010800    Topaz
  13628. >1    belong&0xffffff00    0x00010900    Cast Lightning
  13629. >1    belong&0xffffff00    0x00010a00    Microsoft
  13630. >1    belong&0xffffff00    0x00010b00    Sonic Foundry
  13631. >1    belong&0xffffff00    0x00010c00    Line 6
  13632. >1    belong&0xffffff00    0x00010d00    Beatnik Inc.
  13633. >1    belong&0xffffff00    0x00010e00    Van Koerving
  13634. >1    belong&0xffffff00    0x00010f00    Altech Systems
  13635. >1    belong&0xffffff00    0x00011000    S & S Research
  13636. >1    belong&0xffffff00    0x00011100    VLSI Technology
  13637. >1    belong&0xffffff00    0x00011200    Chromatic
  13638. >1    belong&0xffffff00    0x00011300    Sapphire
  13639. >1    belong&0xffffff00    0x00011400    IDRC
  13640. >1    belong&0xffffff00    0x00011500    Justonic Tuning
  13641. >1    belong&0xffffff00    0x00011600    TorComp
  13642. >1    belong&0xffffff00    0x00011700    Newtek Inc.
  13643. >1    belong&0xffffff00    0x00011800    Sound Sculpture
  13644. >1    belong&0xffffff00    0x00011900    Walker Technical
  13645. >1    belong&0xffffff00    0x00011a00    Digital Harmony
  13646. >1    belong&0xffffff00    0x00011b00    InVision
  13647. >1    belong&0xffffff00    0x00011c00    T-Square
  13648. >1    belong&0xffffff00    0x00011d00    Nemesys
  13649. >1    belong&0xffffff00    0x00011e00    DBX
  13650. >1    belong&0xffffff00    0x00011f00    Syndyne
  13651. >1    belong&0xffffff00    0x00012000    Bitheadz    
  13652. >1    belong&0xffffff00    0x00012100    Cakewalk
  13653. >1    belong&0xffffff00    0x00012200    Staccato
  13654. >1    belong&0xffffff00    0x00012300    National Semicon.
  13655. >1    belong&0xffffff00    0x00012400    Boom Theory
  13656. >1    belong&0xffffff00    0x00012500    Virtual DSP Corp
  13657. >1    belong&0xffffff00    0x00012600    Antares
  13658. >1    belong&0xffffff00    0x00012700    Angel Software
  13659. >1    belong&0xffffff00    0x00012800    St Louis Music
  13660. >1    belong&0xffffff00    0x00012900    Lyrrus dba G-VOX
  13661. >1    belong&0xffffff00    0x00012a00    Ashley Audio
  13662. >1    belong&0xffffff00    0x00012b00    Vari-Lite
  13663. >1    belong&0xffffff00    0x00012c00    Summit Audio
  13664. >1    belong&0xffffff00    0x00012d00    Aureal Semicon.
  13665. >1    belong&0xffffff00    0x00012e00    SeaSound
  13666. >1    belong&0xffffff00    0x00012f00    U.S. Robotics
  13667. >1    belong&0xffffff00    0x00013000    Aurisis
  13668. >1    belong&0xffffff00    0x00013100    Nearfield Multimedia
  13669. >1    belong&0xffffff00    0x00013200    FM7 Inc.
  13670. >1    belong&0xffffff00    0x00013300    Swivel Systems
  13671. >1    belong&0xffffff00    0x00013400    Hyperactive
  13672. >1    belong&0xffffff00    0x00013500    MidiLite
  13673. >1    belong&0xffffff00    0x00013600    Radical
  13674. >1    belong&0xffffff00    0x00013700    Roger Linn
  13675. >1    belong&0xffffff00    0x00013800    Helicon
  13676. >1    belong&0xffffff00    0x00013900    Event
  13677. >1    belong&0xffffff00    0x00013a00    Sonic Network
  13678. >1    belong&0xffffff00    0x00013b00    Realtime Music
  13679. >1    belong&0xffffff00    0x00013c00    Apogee Digital
  13680.  
  13681. >1    belong&0xffffff00    0x00202b00    Medeli Electronics
  13682. >1    belong&0xffffff00    0x00202c00    Charlie Lab
  13683. >1    belong&0xffffff00    0x00202d00    Blue Chip Music
  13684. >1    belong&0xffffff00    0x00202e00    BEE OH Corp
  13685. >1    belong&0xffffff00    0x00202f00    LG Semicon America
  13686. >1    belong&0xffffff00    0x00203000    TESI
  13687. >1    belong&0xffffff00    0x00203100    EMAGIC
  13688. >1    belong&0xffffff00    0x00203200    Behringer
  13689. >1    belong&0xffffff00    0x00203300    Access Music
  13690. >1    belong&0xffffff00    0x00203400    Synoptic
  13691. >1    belong&0xffffff00    0x00203500    Hanmesoft Corp
  13692. >1    belong&0xffffff00    0x00203600    Terratec
  13693. >1    belong&0xffffff00    0x00203700    Proel SpA
  13694. >1    belong&0xffffff00    0x00203800    IBK MIDI
  13695. >1    belong&0xffffff00    0x00203900    IRCAM
  13696. >1    belong&0xffffff00    0x00203a00    Propellerhead Software
  13697. >1    belong&0xffffff00    0x00203b00    Red Sound Systems
  13698. >1    belong&0xffffff00    0x00203c00    Electron ESI AB
  13699. >1    belong&0xffffff00    0x00203d00    Sintefex Audio
  13700. >1    belong&0xffffff00    0x00203e00    Music and More
  13701. >1    belong&0xffffff00    0x00203f00    Amsaro
  13702. >1    belong&0xffffff00    0x00204000    CDS Advanced Technology
  13703. >1    belong&0xffffff00    0x00204100    Touched by Sound
  13704. >1    belong&0xffffff00    0x00204200    DSP Arts
  13705. >1    belong&0xffffff00    0x00204300    Phil Rees Music
  13706. >1    belong&0xffffff00    0x00204400    Stamer Musikanlagen GmbH
  13707. >1    belong&0xffffff00    0x00204500    Soundart
  13708. >1    belong&0xffffff00    0x00204600    C-Mexx Software
  13709. >1    belong&0xffffff00    0x00204700    Klavis Tech.
  13710. >1    belong&0xffffff00    0x00204800    Noteheads AB
  13711.  
  13712. 0    string            T707        Roland TR-707 Data
  13713. #------------------------------------------------------------------------------
  13714. # teapot:  file(1) magic for "teapot" spreadsheet
  13715. #
  13716. 0       string          #!teapot\012xdr      teapot work sheet (XDR format)
  13717.  
  13718. #------------------------------------------------------------------------------
  13719. # terminfo:  file(1) magic for terminfo
  13720. #
  13721. # XXX - byte order for screen images?
  13722. #
  13723. 0    string        \032\001    Compiled terminfo entry
  13724. 0    short        0433        Curses screen image
  13725. 0    short        0434        Curses screen image
  13726. #------------------------------------------------------------------------------
  13727. # tex:  file(1) magic for TeX files
  13728. #
  13729. # XXX - needs byte-endian stuff (big-endian and little-endian DVI?)
  13730. #
  13731. # From <conklin@talisman.kaleida.com>
  13732.  
  13733. # Although we may know the offset of certain text fields in TeX DVI
  13734. # and font files, we can't use them reliably because they are not
  13735. # zero terminated. [but we do anyway, christos]
  13736. 0    string        \367\002    TeX DVI file
  13737. !:mime    application/x-dvi
  13738. >16    string        >\0        (%s)
  13739. 0    string        \367\203    TeX generic font data
  13740. 0    string        \367\131    TeX packed font data
  13741. >3    string        >\0        (%s)
  13742. 0    string        \367\312    TeX virtual font data
  13743. 0    search/1    This\ is\ TeX,    TeX transcript text
  13744. 0    search/1    This\ is\ METAFONT,    METAFONT transcript text
  13745.  
  13746. # There is no way to detect TeX Font Metric (*.tfm) files without
  13747. # breaking them apart and reading the data.  The following patterns
  13748. # match most *.tfm files generated by METAFONT or afm2tfm.
  13749. 2    string        \000\021    TeX font metric data
  13750. !:mime    application/x-tex-tfm
  13751. >33    string        >\0        (%s)
  13752. 2    string        \000\022    TeX font metric data
  13753. !:mime    application/x-tex-tfm
  13754. >33    string        >\0        (%s)
  13755.  
  13756. # Texinfo and GNU Info, from Daniel Quinlan (quinlan@yggdrasil.com)
  13757. 0    search/1    \\input\ texinfo    Texinfo source text
  13758. !:mime    text/x-texinfo
  13759. 0    search/1    This\ is\ Info\ file    GNU Info text
  13760. !:mime    text/x-info
  13761.  
  13762. # TeX documents, from Daniel Quinlan (quinlan@yggdrasil.com)
  13763. 0    search/400    \\input        TeX document text
  13764. !:mime    text/x-tex
  13765. 0    search/400    \\section    LaTeX document text
  13766. !:mime    text/x-tex
  13767. 0    search/400    \\setlength    LaTeX document text
  13768. !:mime    text/x-tex
  13769. 0    search/400    \\documentstyle    LaTeX document text
  13770. !:mime    text/x-tex
  13771. 0    search/400    \\chapter    LaTeX document text
  13772. !:mime    text/x-tex
  13773. 0    search/400    \\documentclass    LaTeX 2e document text
  13774. !:mime    text/x-tex
  13775. 0    search/400    \\relax        LaTeX auxiliary file
  13776. !:mime    text/x-tex
  13777. 0    search/400    \\contentsline    LaTeX table of contents
  13778. !:mime    text/x-tex
  13779. 0    search/400    %\ -*-latex-*-    LaTeX document text
  13780. !:mime    text/x-tex
  13781.  
  13782. # Tex document, from Hendrik Scholz <hendrik@scholz.net>
  13783. 0       search/1    \\ifx        TeX document text
  13784.  
  13785. # Index and glossary files
  13786. 0    search/400    \\indexentry    LaTeX raw index file
  13787. 0    search/400    \\begin{theindex}    LaTeX sorted index
  13788. 0    search/400    \\glossaryentry    LaTeX raw glossary
  13789. 0    search/400    \\begin{theglossary}    LaTeX sorted glossary
  13790. 0    search/400    This\ is\ makeindex    Makeindex log file
  13791.  
  13792. # End of TeX
  13793.  
  13794. #------------------------------------------------------------------------------
  13795. # file(1) magic for BibTex text files
  13796. # From Hendrik Scholz <hendrik@scholz.net>
  13797.  
  13798. 0    search/1/c    @article{    BibTeX text file
  13799. 0    search/1/c    @book{        BibTeX text file
  13800. 0    search/1/c    @inbook{    BibTeX text file
  13801. 0    search/1/c    @incollection{    BibTeX text file
  13802. 0    search/1/c    @inproceedings{    BibTeX text file
  13803. 0    search/1/c    @manual{    BibTeX text file
  13804. 0    search/1/c    @misc{        BibTeX text file
  13805. 0    search/1/c    @preamble{    BibTeX text file
  13806. 0    search/1/c    @phdthesis{    BibTeX text file
  13807. 0    search/1/c    @techreport{    BibTeX text file
  13808. 0    search/1/c    @unpublished{    BibTeX text file
  13809.  
  13810. 73    search/1    %%%\ \         BibTeX-file{ BibTex text file (with full header)
  13811.  
  13812. 73    search/1    %%%\ \ @BibTeX-style-file{   BibTeX style text file (with full header)
  13813.  
  13814. 0    search/1    %\ BibTeX\ standard\ bibliography\     BibTeX standard bibliography style text file
  13815.  
  13816. 0    search/1    %\ BibTeX\ `    BibTeX custom bibliography style text file
  13817.  
  13818. 0    search/1    @c\ @mapfile{    TeX font aliases text file
  13819. #------------------------------------------------------------------------------
  13820. # file(1) magic for tgif(1) files
  13821. # From Hendrik Scholz <hendrik@scholz.net>
  13822.  
  13823. 0    string    %TGIF\ x         Tgif file version %s
  13824.  
  13825. # ------------------------------------------------------------------------
  13826. # ti-8x: file(1) magic for the TI-8x and TI-9x Graphing Calculators.
  13827. #
  13828. # From: Ryan McGuire (rmcguire@freenet.columbus.oh.us).
  13829. #
  13830. # Update: Romain Lievin (roms@lpg.ticalc.org).
  13831. #
  13832. # NOTE: This list is not complete.
  13833. # Files for the TI-80 and TI-81 are pretty rare. I'm not going to put the
  13834. # program/group magic numbers in here because I cannot find any.
  13835. 0        string        **TI80**    TI-80 Graphing Calculator File.
  13836. 0        string        **TI81**    TI-81 Graphing Calculator File.
  13837. #
  13838. # Magic Numbers for the TI-73
  13839. #
  13840. 0        string        **TI73**    TI-73 Graphing Calculator
  13841. >0x00003B    byte        0x00        (real number)
  13842. >0x00003B    byte        0x01        (list)
  13843. >0x00003B    byte        0x02        (matrix)
  13844. >0x00003B    byte        0x03        (equation)
  13845. >0x00003B    byte        0x04        (string)
  13846. >0x00003B    byte        0x05        (program)
  13847. >0x00003B    byte        0x06        (assembly program)
  13848. >0x00003B    byte        0x07        (picture)
  13849. >0x00003B    byte        0x08        (gdb)
  13850. >0x00003B    byte        0x0C        (complex number)
  13851. >0x00003B    byte        0x0F        (window settings)
  13852. >0x00003B    byte        0x10        (zoom)
  13853. >0x00003B    byte        0x11        (table setup)
  13854. >0x00003B    byte        0x13        (backup)
  13855.  
  13856. # Magic Numbers for the TI-82
  13857. #
  13858. 0        string        **TI82**    TI-82 Graphing Calculator
  13859. >0x00003B    byte        0x00        (real)
  13860. >0x00003B    byte        0x01        (list)
  13861. >0x00003B    byte        0x02        (matrix)
  13862. >0x00003B    byte        0x03        (Y-variable)
  13863. >0x00003B    byte        0x05        (program)
  13864. >0x00003B    byte        0x06        (protected prgm)
  13865. >0x00003B    byte        0x07        (picture)
  13866. >0x00003B    byte        0x08        (gdb)
  13867. >0x00003B    byte        0x0B        (window settings)
  13868. >0x00003B    byte        0x0C        (window settings)
  13869. >0x00003B    byte        0x0D        (table setup)
  13870. >0x00003B    byte        0x0E        (screenshot)
  13871. >0x00003B    byte        0x0F        (backup)
  13872. #
  13873. # Magic Numbers for the TI-83
  13874. #
  13875. 0        string        **TI83**    TI-83 Graphing Calculator
  13876. >0x00003B    byte        0x00        (real)
  13877. >0x00003B    byte        0x01        (list)
  13878. >0x00003B    byte        0x02        (matrix)
  13879. >0x00003B    byte        0x03        (Y-variable)
  13880. >0x00003B    byte        0x04        (string)
  13881. >0x00003B    byte        0x05        (program)
  13882. >0x00003B    byte        0x06        (protected prgm)
  13883. >0x00003B    byte        0x07        (picture)
  13884. >0x00003B    byte        0x08        (gdb)
  13885. >0x00003B    byte        0x0B        (window settings)
  13886. >0x00003B    byte        0x0C        (window settings)
  13887. >0x00003B    byte        0x0D        (table setup)
  13888. >0x00003B    byte        0x0E        (screenshot)
  13889. >0x00003B    byte        0x13        (backup)
  13890. #
  13891. # Magic Numbers for the TI-83+
  13892. #
  13893. 0        string        **TI83F*    TI-83+ Graphing Calculator
  13894. >0x00003B    byte        0x00        (real number)
  13895. >0x00003B    byte        0x01        (list)
  13896. >0x00003B    byte        0x02        (matrix)
  13897. >0x00003B    byte        0x03        (equation)
  13898. >0x00003B    byte        0x04        (string)
  13899. >0x00003B    byte        0x05        (program)
  13900. >0x00003B    byte        0x06        (assembly program)
  13901. >0x00003B    byte        0x07        (picture)
  13902. >0x00003B    byte        0x08        (gdb)
  13903. >0x00003B    byte        0x0C        (complex number)
  13904. >0x00003B    byte        0x0F        (window settings)
  13905. >0x00003B    byte        0x10        (zoom)
  13906. >0x00003B    byte        0x11        (table setup)
  13907. >0x00003B    byte        0x13        (backup)
  13908. >0x00003B    byte        0x15        (application variable)
  13909. >0x00003B    byte        0x17        (group of variable)
  13910.  
  13911. #
  13912. # Magic Numbers for the TI-85
  13913. #
  13914. 0        string        **TI85**    TI-85 Graphing Calculator
  13915. >0x00003B    byte        0x00        (real number)
  13916. >0x00003B    byte        0x01        (complex number)
  13917. >0x00003B    byte        0x02        (real vector)
  13918. >0x00003B    byte        0x03        (complex vector)
  13919. >0x00003B    byte        0x04        (real list)
  13920. >0x00003B    byte        0x05        (complex list)
  13921. >0x00003B    byte        0x06        (real matrix)
  13922. >0x00003B    byte        0x07        (complex matrix)
  13923. >0x00003B    byte        0x08        (real constant)
  13924. >0x00003B    byte        0x09        (complex constant)
  13925. >0x00003B    byte        0x0A        (equation)
  13926. >0x00003B    byte        0x0C        (string)
  13927. >0x00003B    byte        0x0D        (function GDB)
  13928. >0x00003B    byte        0x0E        (polar GDB)
  13929. >0x00003B    byte        0x0F        (parametric GDB)
  13930. >0x00003B    byte        0x10        (diffeq GDB)
  13931. >0x00003B    byte        0x11        (picture)
  13932. >0x00003B    byte        0x12        (program)
  13933. >0x00003B    byte        0x13        (range)
  13934. >0x00003B    byte        0x17        (window settings)
  13935. >0x00003B    byte        0x18        (window settings)
  13936. >0x00003B    byte        0x19        (window settings)
  13937. >0x00003B    byte        0x1A        (window settings)
  13938. >0x00003B    byte        0x1B        (zoom)
  13939. >0x00003B    byte        0x1D        (backup)
  13940. >0x00003B    byte        0x1E        (unknown)
  13941. >0x00003B    byte        0x2A        (equation)
  13942. >0x000032    string        ZS4        - ZShell Version 4 File.
  13943. >0x000032    string        ZS3        - ZShell Version 3 File.
  13944. #
  13945. # Magic Numbers for the TI-86
  13946. #
  13947. 0        string        **TI86**    TI-86 Graphing Calculator
  13948. >0x00003B    byte        0x00        (real number)
  13949. >0x00003B    byte        0x01        (complex number)
  13950. >0x00003B    byte        0x02        (real vector)
  13951. >0x00003B    byte        0x03        (complex vector)
  13952. >0x00003B    byte        0x04        (real list)
  13953. >0x00003B    byte        0x05        (complex list)
  13954. >0x00003B    byte        0x06        (real matrix)
  13955. >0x00003B    byte        0x07        (complex matrix)
  13956. >0x00003B    byte        0x08        (real constant)
  13957. >0x00003B    byte        0x09        (complex constant)
  13958. >0x00003B    byte        0x0A        (equation)
  13959. >0x00003B    byte        0x0C        (string)
  13960. >0x00003B    byte        0x0D        (function GDB)
  13961. >0x00003B    byte        0x0E        (polar GDB)
  13962. >0x00003B    byte        0x0F        (parametric GDB)
  13963. >0x00003B    byte        0x10        (diffeq GDB)
  13964. >0x00003B    byte        0x11        (picture)
  13965. >0x00003B    byte        0x12        (program)
  13966. >0x00003B    byte        0x13        (range)
  13967. >0x00003B    byte        0x17        (window settings)
  13968. >0x00003B    byte        0x18        (window settings)
  13969. >0x00003B    byte        0x19        (window settings)
  13970. >0x00003B    byte        0x1A        (window settings)
  13971. >0x00003B    byte        0x1B        (zoom)
  13972. >0x00003B    byte        0x1D        (backup)
  13973. >0x00003B    byte        0x1E        (unknown)
  13974. >0x00003B    byte        0x2A        (equation)
  13975. #
  13976. # Magic Numbers for the TI-89
  13977. #
  13978. 0        string        **TI89**    TI-89 Graphing Calculator
  13979. >0x000048    byte        0x00        (expression)
  13980. >0x000048    byte        0x04        (list)
  13981. >0x000048    byte        0x06        (matrix)
  13982. >0x000048    byte        0x0A        (data)
  13983. >0x000048    byte        0x0B        (text)
  13984. >0x000048    byte        0x0C        (string)
  13985. >0x000048    byte        0x0D        (graphic data base)
  13986. >0x000048    byte        0x0E        (figure)
  13987. >0x000048    byte        0x10        (picture)
  13988. >0x000048    byte        0x12        (program)
  13989. >0x000048    byte        0x13        (function)
  13990. >0x000048    byte        0x14        (macro)
  13991. >0x000048    byte        0x1C        (zipped)
  13992. >0x000048    byte        0x21        (assembler)
  13993. #
  13994. # Magic Numbers for the TI-92
  13995. #
  13996. 0        string        **TI92**    TI-92 Graphing Calculator
  13997. >0x000048    byte        0x00        (expression)
  13998. >0x000048    byte        0x04        (list)
  13999. >0x000048    byte        0x06        (matrix)
  14000. >0x000048    byte        0x0A        (data)
  14001. >0x000048    byte        0x0B        (text)
  14002. >0x000048    byte        0x0C        (string)
  14003. >0x000048    byte        0x0D        (graphic data base)
  14004. >0x000048    byte        0x0E        (figure)
  14005. >0x000048    byte        0x10        (picture)
  14006. >0x000048    byte        0x12        (program)
  14007. >0x000048    byte        0x13        (function)
  14008. >0x000048    byte        0x14        (macro)
  14009. >0x000048    byte        0x1D        (backup)
  14010. #
  14011. # Magic Numbers for the TI-92+/V200
  14012. #
  14013. 0        string        **TI92P*    TI-92+/V200 Graphing Calculator
  14014. >0x000048    byte        0x00        (expression)
  14015. >0x000048    byte        0x04        (list)
  14016. >0x000048    byte        0x06        (matrix)
  14017. >0x000048    byte        0x0A        (data)
  14018. >0x000048    byte        0x0B        (text)
  14019. >0x000048    byte        0x0C        (string)
  14020. >0x000048    byte        0x0D        (graphic data base)
  14021. >0x000048    byte        0x0E        (figure)
  14022. >0x000048    byte        0x10        (picture)
  14023. >0x000048    byte        0x12        (program)
  14024. >0x000048    byte        0x13        (function)
  14025. >0x000048    byte        0x14        (macro)
  14026. >0x000048    byte        0x1C        (zipped)
  14027. >0x000048    byte        0x21        (assembler)
  14028. #
  14029. # Magic Numbers for the TI-73/83+/89/92+/V200 FLASH upgrades
  14030. #
  14031. 0x0000016    string        Advanced    TI-XX Graphing Calculator (FLASH)
  14032. 0        string        **TIFL**    TI-XX Graphing Calculator (FLASH)
  14033. >8        byte        >0        - Revision %d
  14034. >>9         byte        x        \b.%d,
  14035. >12        byte        >0        Revision date %02x
  14036. >>13        byte        x        \b/%02x
  14037. >>14        beshort        x        \b/%04x,
  14038. >17        string        >/0        name: '%s',
  14039. >48        byte        0x74        device: TI-73,
  14040. >48        byte        0x73        device: TI-83+,
  14041. >48        byte        0x98        device: TI-89,
  14042. >48        byte        0x88        device: TI-92+,
  14043. >49        byte        0x23        type: OS upgrade,
  14044. >49        byte        0x24        type: application,
  14045. >49        byte        0x25        type: certificate,
  14046. >49        byte        0x3e        type: license,
  14047. >74        lelong        >0        size: %ld bytes
  14048.  
  14049. # VTi & TiEmu skins (TI Graphing Calculators).
  14050. # From: Romain Lievin (roms@lpg.ticalc.org).
  14051. # Magic Numbers for the VTi skins
  14052. 0               string          VTI        Virtual TI skin
  14053. >3        string        v        - Version
  14054. >>4        byte        >0        \b %c
  14055. >>6        byte        x        \b.%c
  14056. # Magic Numbers for the TiEmu skins
  14057. 0        string        TiEmu        TiEmu skin
  14058. >6              string          v               - Version
  14059. >>7             byte            >0              \b %c
  14060. >>9             byte            x               \b.%c
  14061. >>10        byte        x        \b%c
  14062.  
  14063. #------------------------------------------------------------------------------
  14064. # timezone:  file(1) magic for timezone data
  14065. #
  14066. # from Daniel Quinlan (quinlan@yggdrasil.com)
  14067. # this should work on Linux, SunOS, and maybe others
  14068. # Added new official magic number for recent versions of the Olson code
  14069. 0    string    TZif    timezone data
  14070. 0    string    \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0    old timezone data
  14071. 0    string    \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\2\0    old timezone data
  14072. 0    string  \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\3\0    old timezone data
  14073. 0    string    \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0    old timezone data
  14074. 0    string    \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0    old timezone data
  14075. 0    string    \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\6\0    old timezone data
  14076. #------------------------------------------------------------------------------
  14077. # troff:  file(1) magic for *roff
  14078. #
  14079. # updated by Daniel Quinlan (quinlan@yggdrasil.com)
  14080.  
  14081. # troff input
  14082. 0    search/1    .\\"        troff or preprocessor input text
  14083. !:mime    text/troff
  14084. 0    search/1    '\\"        troff or preprocessor input text
  14085. !:mime    text/troff
  14086. 0    search/1    '.\\"        troff or preprocessor input text
  14087. !:mime    text/troff
  14088. 0    search/1    \\"        troff or preprocessor input text
  14089. !:mime    text/troff
  14090. 0    search/1    '''        troff or preprocessor input text
  14091. !:mime    text/troff
  14092.  
  14093. # ditroff intermediate output text
  14094. 0    search/1    x\ T        ditroff output text
  14095. >4    search/1    cat        for the C/A/T phototypesetter
  14096. >4    search/1    ps        for PostScript
  14097. >4    search/1    dvi        for DVI
  14098. >4    search/1    ascii        for ASCII
  14099. >4    search/1    lj4        for LaserJet 4
  14100. >4    search/1    latin1        for ISO 8859-1 (Latin 1)
  14101. >4    search/1    X75        for xditview at 75dpi
  14102. >>7    search/1    -12        (12pt)
  14103. >4    search/1    X100        for xditview at 100dpi
  14104. >>8    search/1    -12        (12pt)
  14105.  
  14106. # output data formats
  14107. 0    string        \100\357    very old (C/A/T) troff output data
  14108. #
  14109. #------------------------------------------------------------------------------
  14110. # tuxedo:    file(1) magic for BEA TUXEDO data files
  14111. #
  14112. # from Ian Springer <ispringer@hotmail.com>
  14113. #
  14114. 0    string        \0\0\1\236\0\0\0\0\0\0\0\0\0\0\0\0    BEA TUXEDO DES mask data
  14115.  
  14116. #------------------------------------------------------------------------------
  14117. # typeset:  file(1) magic for other typesetting
  14118. #
  14119. 0    string        Interpress/Xerox    Xerox InterPress data
  14120. >16    string        /            (version
  14121. >>17    string        >\0            %s)
  14122. #---------------------------------------------------------------------------
  14123. # Unicode:  BOM prefixed text files - Adrian Havill <havill@turbolinux.co.jp>
  14124. # GRR: These types should be recognised in file_ascmagic so these
  14125. # encodings can be treated by text patterns.
  14126. # Missing types are already dealt with internally.
  14127. #
  14128. 0    string    +/v8            Unicode text, UTF-7
  14129. 0    string    +/v9            Unicode text, UTF-7
  14130. 0    string    +/v+            Unicode text, UTF-7
  14131. 0    string    +/v/            Unicode text, UTF-7
  14132. 0    string    \335\163\146\163    Unicode text, UTF-8-EBCDIC
  14133. 0    string    \376\377\000\000    Unicode text, UTF-32, big-endian
  14134. 0    string    \377\376\000\000    Unicode text, UTF-32, little-endian
  14135. 0    string    \016\376\377        Unicode text, SCSU (Standard Compression Scheme for Unicode)
  14136.  
  14137. #------------------------------------------------------------------------------
  14138. # unknown:  file(1) magic for unknown machines
  14139. #
  14140. # XXX - this probably should be pruned, as it'll match PDP-11 and
  14141. # VAX image formats.
  14142. #
  14143. # 0x107 is 0407; 0x108 is 0410; both are PDP-11 (executable and pure,
  14144. # respectively).
  14145. #
  14146. # 0x109 is 0411; that's PDP-11 split I&D, but the PDP-11 version doesn't
  14147. # have the "version %ld", which may be a bogus COFFism (I don't think
  14148. # there ever was COFF for the PDP-11).
  14149. #
  14150. # 0x10B is 0413; that's VAX demand-paged, but this is a short, not a
  14151. # long, as it would be on a VAX.
  14152. #
  14153. # 0x10C is 0414 and 0x10E is 416; those *are* unknown.
  14154. #
  14155. 0    short        0x107        unknown machine executable
  14156. >8    short        >0        not stripped
  14157. >15    byte        >0        - version %ld
  14158. 0    short        0x108        unknown pure executable
  14159. >8    short        >0        not stripped
  14160. >15    byte        >0        - version %ld
  14161. 0    short        0x109        PDP-11 separate I&D
  14162. >8    short        >0        not stripped
  14163. >15    byte        >0        - version %ld
  14164. 0    short        0x10b        unknown pure executable
  14165. >8    short        >0        not stripped
  14166. >15    byte        >0        - version %ld
  14167. 0    long        0x10c        unknown demand paged pure executable
  14168. >16    long        >0        not stripped
  14169. 0    long        0x10e        unknown readable demand paged pure executable
  14170. #------------------------------------------------------------------------------
  14171. # uuencode:  file(1) magic for ASCII-encoded files
  14172. #
  14173.  
  14174. # GRR:  the first line of xxencoded files is identical to that in uuencoded
  14175. # files, but the first character in most subsequent lines is 'h' instead of
  14176. # 'M'.  (xxencoding uses lowercase letters in place of most of uuencode's
  14177. # punctuation and survives BITNET gateways better.)  If regular expressions
  14178. # were supported, this entry could possibly be split into two with
  14179. # "begin\040\.\*\012M" or "begin\040\.\*\012h" (where \. and \* are REs).
  14180. 0    search/1    begin\         uuencoded or xxencoded text
  14181.  
  14182. # btoa(1) is an alternative to uuencode that requires less space.
  14183. 0    search/1    xbtoa\ Begin    btoa'd text
  14184.  
  14185. # ship(1) is another, much cooler alternative to uuencode.
  14186. # Greg Roelofs, newt@uchicago.edu
  14187. 0    search/1    $\012ship    ship'd binary text
  14188.  
  14189. # bencode(8) is used to encode compressed news batches (Bnews/Cnews only?)
  14190. # Greg Roelofs, newt@uchicago.edu
  14191. 0    search/1    Decode\ the\ following\ with\ bdeco    bencoded News text
  14192.  
  14193. # BinHex is the Macintosh ASCII-encoded file format (see also "apple")
  14194. # Daniel Quinlan, quinlan@yggdrasil.com
  14195. 11    search/1    must\ be\ converted\ with\ BinHex    BinHex binary text
  14196. >41    search/1    x                    \b, version %.3s
  14197.  
  14198. # GRR: handle BASE64
  14199.  
  14200. #------------------------------------------------------------------------------
  14201. # varied.out:  file(1) magic for various USG systems
  14202. #
  14203. #    Herewith many of the object file formats used by USG systems.
  14204. #    Most have been moved to files for a particular processor,
  14205. #    and deleted if they duplicate other entries.
  14206. #
  14207. 0    short        0610        Perkin-Elmer executable
  14208. # AMD 29K
  14209. 0    beshort        0572        amd 29k coff noprebar executable
  14210. 0    beshort        01572        amd 29k coff prebar executable
  14211. 0    beshort        0160007        amd 29k coff archive
  14212. # Cray
  14213. 6    beshort        0407        unicos (cray) executable
  14214. # Ultrix 4.3
  14215. 596    string        \130\337\377\377    Ultrix core file
  14216. >600    string        >\0        from '%s'
  14217. # BeOS and MAcOS PEF executables
  14218. # From: hplus@zilker.net (Jon Watte)
  14219. 0    string        Joy!peffpwpc    header for PowerPC PEF executable
  14220. #
  14221. # ava assembler/linker Uros Platise <uros.platise@ijs.si>
  14222. 0       string          avaobj  AVR assembler object code
  14223. >7      string          >\0     version '%s'
  14224. # gnu gmon magic From: Eugen Dedu <dedu@ese-metz.fr>
  14225. 0    string        gmon        GNU prof performance data
  14226. >4    long        x        - version %ld
  14227. # From: Dave Pearson <davep@davep.org>
  14228. # Harbour <URL:http://www.harbour-project.org/> HRB files.
  14229. 0    string        \xc0HRB        Harbour HRB file
  14230. >4    short        x        version %d
  14231.  
  14232. # From: Alex Beregszaszi <alex@fsn.hu>
  14233. # 0    string        exec         BugOS executable
  14234. # 0    string        pack        BugOS archive
  14235.  
  14236. # From: Jason Spence <jspence@lightconsulting.com>
  14237. # Generated by the "examples" in STM's ST40 devkit, and derived code.
  14238. 0    lelong        0x13a9f17e    ST40 component image format
  14239. >4    string        >\0        \b, name '%s'
  14240.  
  14241. #------------------------------------------------------------------------------
  14242. # varied.script:  file(1) magic for various interpreter scripts
  14243.  
  14244. 0    string        #!\ /            a
  14245. >3    string        >\0            %s script text executable
  14246. 0    string        #!\t/            a
  14247. >3    string        >\0            %s script text executable
  14248. 0    string        #!/            a
  14249. >2    string        >\0            %s script text executable
  14250. 0    string        #!\             script text executable
  14251. >3    string        >\0            for %s
  14252.  
  14253. # From: arno <arenevier@fdn.fr>
  14254. # mozilla xpconnect typelib
  14255. # see http://www.mozilla.org/scriptable/typelib_file.html
  14256. 0    string         XPCOM\nTypeLib\r\n\032        XPConnect Typelib
  14257. >0x10  byte        x       version %d
  14258. >>0x11 byte        x      \b.%d
  14259.  
  14260. #------------------------------------------------------------------------------
  14261. # vax:  file(1) magic for VAX executable/object and APL workspace
  14262. #
  14263. 0    lelong        0101557        VAX single precision APL workspace
  14264. 0    lelong        0101556        VAX double precision APL workspace
  14265.  
  14266. #
  14267. # VAX a.out (32V, BSD)
  14268. #
  14269. 0    lelong        0407        VAX executable
  14270. >16    lelong        >0        not stripped
  14271.  
  14272. 0    lelong        0410        VAX pure executable
  14273. >16    lelong        >0        not stripped
  14274.  
  14275. 0    lelong        0413        VAX demand paged pure executable
  14276. >16    lelong        >0        not stripped
  14277.  
  14278. 0    lelong        0420        VAX demand paged (first page unmapped) pure executable
  14279. >16    lelong        >0        not stripped
  14280.  
  14281. #
  14282. # VAX COFF
  14283. #
  14284. # The `versions' should be un-commented if they work for you.
  14285. # (Was the problem just one of endianness?)
  14286. #
  14287. 0    leshort        0570        VAX COFF executable
  14288. >12    lelong        >0        not stripped
  14289. >22    leshort        >0        - version %ld
  14290. 0    leshort        0575        VAX COFF pure executable
  14291. >12    lelong        >0        not stripped
  14292. >22    leshort        >0        - version %ld
  14293.  
  14294. #------------------------------------------------------------------------------
  14295. # vicar:  file(1) magic for VICAR files.
  14296. #
  14297. # From: Ossama Othman <othman@astrosun.tn.cornell.edu
  14298. # VICAR is JPL's in-house spacecraft image processing program
  14299. # VICAR image
  14300. 0    string    LBLSIZE=    VICAR image data
  14301. >32    string    BYTE        \b, 8 bits  = VAX byte
  14302. >32    string    HALF        \b, 16 bits = VAX word     = Fortran INTEGER*2
  14303. >32    string    FULL        \b, 32 bits = VAX longword = Fortran INTEGER*4
  14304. >32    string    REAL        \b, 32 bits = VAX longword = Fortran REAL*4
  14305. >32    string    DOUB        \b, 64 bits = VAX quadword = Fortran REAL*8
  14306. >32    string    COMPLEX        \b, 64 bits = VAX quadword = Fortran COMPLEX*8
  14307. # VICAR label file
  14308. 43    string    SFDU_LABEL    VICAR label file
  14309. #------------------------------------------------------------------------------
  14310. # Virtutech Compressed Random Access File Format
  14311. #
  14312. # From <gustav@virtutech.com>
  14313. 0      string          \211\277\036\203        Virtutech CRAFF
  14314. >4     belong          x               v%d
  14315. >20    belong          0               uncompressed
  14316. >20    belong          1               bzipp2ed
  14317. >20    belong          2               gzipped
  14318. >24    belong          0               not clean
  14319.  
  14320. #------------------------------------------------------------------------------
  14321. # visx:  file(1) magic for Visx format files
  14322. #
  14323. 0    short        0x5555        VISX image file
  14324. >2    byte        0        (zero)
  14325. >2    byte        1        (unsigned char)
  14326. >2    byte        2        (short integer)
  14327. >2    byte        3        (float 32)
  14328. >2    byte        4        (float 64)
  14329. >2    byte        5        (signed char)
  14330. >2    byte        6        (bit-plane)
  14331. >2    byte        7        (classes)
  14332. >2    byte        8        (statistics)
  14333. >2    byte        10        (ascii text)
  14334. >2    byte        15        (image segments)
  14335. >2    byte        100        (image set)
  14336. >2    byte        101        (unsigned char vector)
  14337. >2    byte        102        (short integer vector)
  14338. >2    byte        103        (float 32 vector)
  14339. >2    byte        104        (float 64 vector)
  14340. >2    byte        105        (signed char vector)
  14341. >2    byte        106        (bit plane vector)
  14342. >2    byte        121        (feature vector)
  14343. >2    byte        122        (feature vector library)
  14344. >2    byte        124        (chain code)
  14345. >2    byte        126        (bit vector)
  14346. >2    byte        130        (graph)
  14347. >2    byte        131        (adjacency graph)
  14348. >2    byte        132        (adjacency graph library)
  14349. >2    string        .VISIX        (ascii text)
  14350.  
  14351. #------------------------------------------------------------------------------
  14352. # vms:  file(1) magic for VMS executables (experimental)
  14353. #
  14354. # VMS .exe formats, both VAX and AXP (Greg Roelofs, newt@uchicago.edu)
  14355.  
  14356. # GRR 950122:  I'm just guessing on these, based on inspection of the headers
  14357. # of three executables each for Alpha and VAX architectures.  The VAX files
  14358. # all had headers similar to this:
  14359. #
  14360. #   00000  b0 00 30 00 44 00 60 00  00 00 00 00 30 32 30 35  ..0.D.`.....0205
  14361. #   00010  01 01 00 00 ff ff ff ff  ff ff ff ff 00 00 00 00  ................
  14362. #
  14363. 0    string    \xb0\0\x30\0    VMS VAX executable
  14364. >44032    string    PK\003\004    \b, Info-ZIP SFX archive v5.12 w/decryption
  14365. #
  14366. # The AXP files all looked like this, except that the byte at offset 0x22
  14367. # was 06 in some of them and 07 in others:
  14368. #
  14369. #   00000  03 00 00 00 00 00 00 00  ec 02 00 00 10 01 00 00  ................
  14370. #   00010  68 00 00 00 98 00 00 00  b8 00 00 00 00 00 00 00  h...............
  14371. #   00020  00 00 07 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
  14372. #   00030  00 00 00 00 01 00 00 00  00 00 00 00 00 00 00 00  ................
  14373. #   00040  00 00 00 00 ff ff ff ff  ff ff ff ff 02 00 00 00  ................
  14374. #
  14375. 0    belong    0x03000000    VMS Alpha executable
  14376. >75264    string    PK\003\004    \b, Info-ZIP SFX archive v5.12 w/decryption
  14377.  
  14378. # -----------------------------------------------------------
  14379. # VMware specific files (deducted from version 1.1 and log file entries)
  14380. # Anthon van der Neut (anthon@mnt.org)
  14381. 0    belong    0x4d52564e    VMware nvram 
  14382.  
  14383. #------------------------------------------------------------------------------
  14384. # vorbis:  file(1) magic for Ogg/Vorbis files
  14385. #
  14386. # From Felix von Leitner <leitner@fefe.de>
  14387. # Extended by Beni Cherniavsky <cben@crosswinds.net>
  14388. # Further extended by Greg Wooledge <greg@wooledge.org>
  14389. #
  14390. # Most (everything but the number of channels and bitrate) is commented
  14391. # out with `##' as it's not interesting to the average user.  The most
  14392. # probable things advanced users would want to uncomment are probably
  14393. # the number of comments and the encoder version.
  14394. #
  14395. # FIXME: The first match has been made a search, so that it can skip
  14396. # over prepended ID3 tags. This will work for MIME type detection, but
  14397. # won't work for detecting other properties of the file (they all need
  14398. # to be made relative to the search). In any case, if the file has ID3
  14399. # tags, the ID3 information will be printed, not the Ogg information,
  14400. # so until that's fixed, this doesn't matter.
  14401. # FIXME[2]: Disable the above for now, since search assumes text mode.
  14402. #
  14403. # --- Ogg Framing ---
  14404. #0        search/1000    OggS        Ogg data
  14405. 0        string    OggS        Ogg data
  14406. !:mime        application/ogg
  14407. >4        byte        !0        UNKNOWN REVISION %u
  14408. ##>4        byte        0        revision 0
  14409. >4        byte        0
  14410. ##>>14        lelong        x        (Serial %lX)
  14411. # non-Vorbis content: FLAC (Free Lossless Audio Codec, http://flac.sourceforge.net)
  14412. >>28        string        \x7fFLAC    \b, FLAC audio
  14413. # non-Vorbis content: Theora
  14414. >>28        string        \x80theora    \b, Theora video
  14415. # non-Vorbis content: Kate
  14416. >>28        string        \x80kate\0\0\0\0    \b, Kate
  14417. >>>37        ubyte        x        v%u
  14418. >>>38        ubyte        x        \b.%u,
  14419. >>>40        byte        0        utf8 encoding,
  14420. >>>40        byte        !0        unknown character encoding,
  14421. >>>60        string        >\0        language %s,
  14422. >>>60        string        \0        no language set,
  14423. >>>76        string        >\0        category %s
  14424. >>>76        string        \0        no category set
  14425. # non-Vorbis content: Skeleton
  14426. >>28        string        fishead\0    \b, Skeleton
  14427. >>>36        short        x        v%u
  14428. >>>40        short        x        \b.%u
  14429. # non-Vorbis content: Speex
  14430. >>28        string        Speex\ \ \     \b, Speex audio
  14431. # non-Vorbis content: OGM
  14432. >>28        string        \x01video\0\0\0    \b, OGM video
  14433. >>>37        string/c    div3        (DivX 3)
  14434. >>>37        string/c    divx        (DivX 4)
  14435. >>>37        string/c    dx50        (DivX 5)
  14436. >>>37        string/c    xvid        (XviD)
  14437. # --- First vorbis packet - general header ---
  14438. >>28        string        \x01vorbis    \b, Vorbis audio,
  14439. >>>35        lelong        !0        UNKNOWN VERSION %lu,
  14440. ##>>>35        lelong        0        version 0,
  14441. >>>35        lelong        0
  14442. >>>>39        ubyte        1        mono,
  14443. >>>>39        ubyte        2        stereo,
  14444. >>>>39        ubyte        >2        %u channels,
  14445. >>>>40        lelong        x        %lu Hz
  14446. # Minimal, nominal and maximal bitrates specified when encoding
  14447. >>>>48        string        <\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff    \b,
  14448. # The above tests if at least one of these is specified:
  14449. >>>>>52        lelong        !-1
  14450. # Vorbis RC2 has a bug which puts -1000 in the min/max bitrate fields
  14451. # instead of -1.
  14452. # Vorbis 1.0 uses 0 instead of -1.
  14453. >>>>>>52    lelong        !0
  14454. >>>>>>>52    lelong        !-1000
  14455. >>>>>>>>52    lelong        x        <%lu
  14456. >>>>>48        lelong        !-1
  14457. >>>>>>48    lelong        x        ~%lu
  14458. >>>>>44        lelong        !-1
  14459. >>>>>>44    lelong        !-1000
  14460. >>>>>>>44    lelong        !0
  14461. >>>>>>>>44    lelong        x        >%lu
  14462. >>>>>48        string        <\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff    bps
  14463. # -- Second vorbis header packet - the comments
  14464. # A kludge to read the vendor string.  It's a counted string, not a
  14465. # zero-terminated one, so file(1) can't read it in a generic way.
  14466. # libVorbis is the only one existing currently, so I detect specifically
  14467. # it.  The interesting value is the cvs date (8 digits decimal).
  14468. # Post-RC1 Ogg files have the second header packet (and thus the version)
  14469. # in a different place, so we must use an indirect offset.
  14470. >>>(84.b+85)        string        \x03vorbis
  14471. >>>>(84.b+96)        string/c    Xiphophorus\ libVorbis\ I    \b, created by: Xiphophorus libVorbis I
  14472. >>>>>(84.b+120)        string        >00000000    
  14473. # Map to beta version numbers:
  14474. >>>>>>(84.b+120)    string        <20000508    (<beta1, prepublic)
  14475. >>>>>>(84.b+120)    string        20000508    (1.0 beta 1 or beta 2)
  14476. >>>>>>(84.b+120)    string        >20000508
  14477. >>>>>>>(84.b+120)    string        <20001031    (beta2-3)
  14478. >>>>>>(84.b+120)    string        20001031    (1.0 beta 3)
  14479. >>>>>>(84.b+120)    string        >20001031
  14480. >>>>>>>(84.b+120)    string        <20010225    (beta3-4)
  14481. >>>>>>(84.b+120)    string        20010225    (1.0 beta 4)
  14482. >>>>>>(84.b+120)    string        >20010225
  14483. >>>>>>>(84.b+120)    string        <20010615    (beta4-RC1)
  14484. >>>>>>(84.b+120)    string        20010615    (1.0 RC1)
  14485. >>>>>>(84.b+120)    string        20010813    (1.0 RC2)
  14486. >>>>>>(84.b+120)    string        20010816    (RC2 - Garf tuned v1)
  14487. >>>>>>(84.b+120)    string        20011014    (RC2 - Garf tuned v2)
  14488. >>>>>>(84.b+120)    string        20011217    (1.0 RC3)
  14489. >>>>>>(84.b+120)    string        20011231    (1.0 RC3)
  14490. # Some pre-1.0 CVS snapshots still had "Xiphphorus"...
  14491. >>>>>>(84.b+120)    string        >20011231    (pre-1.0 CVS)
  14492. # For the 1.0 release, Xiphophorus is replaced by Xiph.Org
  14493. >>>>(84.b+96)        string/c    Xiph.Org\ libVorbis\ I    \b, created by: Xiph.Org libVorbis I
  14494. >>>>>(84.b+117)        string        >00000000    
  14495. >>>>>>(84.b+117)    string        <20020717    (pre-1.0 CVS)
  14496. >>>>>>(84.b+117)    string        20020717    (1.0)
  14497. >>>>>>(84.b+117)    string        20030909    (1.0.1)
  14498. >>>>>>(84.b+117)    string        20040629    (1.1.0 RC1)
  14499.  
  14500. #------------------------------------------------------------------------------
  14501. # VXL: file(1) magic for VXL binary IO data files
  14502. #
  14503. # from Ian Scott <scottim@sf.net>
  14504. #
  14505. # VXL is a collection of C++ libraries for Computer Vision.
  14506. # See the vsl chapter in the VXL Book for more info
  14507. # http://www.isbe.man.ac.uk/public_vxl_doc/books/vxl/book.html
  14508. # http:/vxl.sf.net
  14509.  
  14510. 2    lelong    0x472b2c4e    VXL data file,
  14511. >0    leshort    >0        schema version no %d
  14512.  
  14513. #------------------------------------------------------------------------------
  14514. # warc:  file(1) magic for WARC files
  14515.  
  14516. 0    string    WARC/    WARC Archive
  14517. >5    string    x    version %.4s
  14518. #------------------------------------------------------------------------------
  14519. # weak:  file(1) magic for very weak magic entries, disabled by default
  14520. #
  14521. # These entries are so weak that they might interfere identification of
  14522. # other formats. Example include:
  14523. # - Only identify for 1 or 2 bytes
  14524. # - Match against very wide range of values
  14525. # - Match against generic word in some spoken languages (e.g. English)
  14526.  
  14527. # Summary: Computer Graphics Metafile
  14528. # Extension: .cgm
  14529. #0    beshort&0xffe0    0x0020        binary Computer Graphics Metafile
  14530. #0    beshort        0x3020        character Computer Graphics Metafile
  14531.  
  14532. #0    string        =!!        Bennet Yee's "face" format
  14533.  
  14534. #------------------------------------------------------------------------------
  14535. # windows:  file(1) magic for Microsoft Windows
  14536. #
  14537. # This file is mainly reserved for files where programs
  14538. # using them are run almost always on MS Windows 3.x or
  14539. # above, or files only used exclusively in Windows OS,
  14540. # where there is no better category to allocate for.
  14541. # For example, even though WinZIP almost run on Windows
  14542. # only, it is better to treat them as "archive" instead.
  14543. # For format usable in DOS, such as generic executable
  14544. # format, please specify under "msdos" file.
  14545. #
  14546.  
  14547.  
  14548. # Summary: Outlook Express DBX file
  14549. # Extension: .dbx
  14550. # Created by: Christophe Monniez
  14551. 0    string    \xCF\xAD\x12\xFE    MS Outlook Express DBX file
  14552. >4    byte    =0xC5            \b, message database
  14553. >4    byte    =0xC6            \b, folder database
  14554. >4    byte    =0xC7            \b, account information
  14555. >4    byte    =0x30            \b, offline database
  14556.  
  14557.  
  14558. # Summary: Windows crash dump
  14559. # Extension: .dmp
  14560. # Created by: Andreas Schuster (http://computer.forensikblog.de/)
  14561. # Reference (1): http://computer.forensikblog.de/en/2008/02/64bit_magic.html
  14562. # Modified by (1): Abel Cheung (Avoid match with first 4 bytes only)
  14563. 0    string        PAGE        
  14564. >4    string        DUMP        MS Windows 32bit crash dump
  14565. >>0x05c    byte            0        \b, no PAE
  14566. >>0x05c    byte            1        \b, PAE
  14567. >>0xf88    lelong        1        \b, full dump
  14568. >>0xf88    lelong        2        \b, kernel dump
  14569. >>0xf88    lelong        3        \b, small dump
  14570. >>0x068    lelong        x        \b, %ld pages
  14571. >4    string        DU64        MS Windows 64bit crash dump
  14572. >>0xf98    lelong        1        \b, full dump
  14573. >>0xf98    lelong        2        \b, kernel dump
  14574. >>0xf98    lelong        3        \b, small dump
  14575. >>0x090    lequad        x        \b, %lld pages
  14576.  
  14577.  
  14578. # Summary: Vista Event Log
  14579. # Extension: .evtx
  14580. # Created by: Andreas Schuster (http://computer.forensikblog.de/)
  14581. # Reference (1): http://computer.forensikblog.de/en/2007/05/some_magic.html
  14582. 0    string        ElfFile\0    MS Windows Vista Event Log
  14583. >0x2a    leshort        x        \b, %d chunks
  14584. >>0x10    lelong        x        \b (no. %d in use)
  14585. >0x18    lelong        >1        \b, next record no. %d
  14586. >0x18    lelong        =1        \b, empty
  14587. >0x78    lelong        &1        \b, DIRTY
  14588. >0x78    lelong        &2        \b, FULL
  14589.  
  14590.  
  14591. # Summary: Windows 3.1 group files
  14592. # Extension: .grp
  14593. # Created by: unknown
  14594. 0    string        \120\115\103\103    MS Windows 3.1 group files
  14595.  
  14596.  
  14597. # Summary: Old format help files
  14598. # Extension: .hlp
  14599. # Created by: Dirk Jagdmann <doj@cubic.org>
  14600. 0    lelong        0x00035f3f        MS Windows 3.x help file
  14601.  
  14602.  
  14603. # Summary: Hyper terminal
  14604. # Extension: .ht
  14605. # Created by: unknown
  14606. 0    string        HyperTerminal\ 
  14607. >15    string        1.0\ --\ HyperTerminal\ data\ file    MS Windows HyperTerminal profile
  14608.  
  14609.  
  14610. # Summary: Windows shortcut
  14611. # Extension: .lnk
  14612. # Created by: unknown
  14613. 0    string        \114\0\0\0\001\024\002\0\0\0\0\0\300\0\0\0\0\0\0\106    MS Windows shortcut
  14614.  
  14615.  
  14616. # Summary: Outlook Personal Folders
  14617. # Created by: unknown
  14618. 0    lelong        0x4E444221    Microsoft Outlook email folder
  14619. >10    leshort        0x0e        (<=2002)
  14620. >10    leshort        0x17        (>=2003)
  14621.  
  14622.  
  14623. # Summary: Windows help cache
  14624. # Created by: unknown
  14625. 0    string        \164\146\115\122\012\000\000\000\001\000\000\000    MS Windows help cache
  14626.  
  14627.  
  14628. # Summary: IE cache file
  14629. # Created by: Christophe Monniez
  14630. 0    string    Client\ UrlCache\ MMF     Internet Explorer cache file
  14631. >20    string    >\0            version %s
  14632.  
  14633.  
  14634. # Summary: Registry files
  14635. # Created by: unknown
  14636. # Modified by (1): Joerg Jenderek
  14637. 0    string        regf        MS Windows registry file, NT/2000 or above
  14638. 0    string        CREG        MS Windows 95/98/ME registry file
  14639. 0    string        SHCC3        MS Windows 3.1 registry file
  14640.  
  14641.  
  14642. # Summary: Windows Registry text
  14643. # Extension: .reg
  14644. # Submitted by: Abel Cheung <abelcheung@gmail.com>
  14645. 0    string        REGEDIT4\r\n\r\n    Windows Registry text (Win95 or above)
  14646. 0    string        Windows\ Registry\ Editor\ 
  14647. >&0    string        Version\ 5.00\r\n\r\n    Windows Registry text (Win2K or above)
  14648. #------------------------------------------------------------------------------
  14649. # wordprocessors:  file(1) magic fo word processors.
  14650. #
  14651. ####### PWP file format used on Smith Corona Personal Word Processors:
  14652. 2    string    \040\040\040\040\040\040\040\040\040\040\040ML4D\040'92    Smith Corona PWP
  14653. >24    byte    2    \b, single spaced
  14654. >24    byte    3    \b, 1.5 spaced
  14655. >24    byte    4    \b, double spaced
  14656. >25    byte    0x42    \b, letter
  14657. >25    byte    0x54    \b, legal
  14658. >26    byte    0x46    \b, A4
  14659.  
  14660. #WordPerfect type files Version 1.6 - PLEASE DO NOT REMOVE THIS LINE
  14661. 0    string    \377WPC\020\000\000\000\022\012\001\001\000\000\000\000    (WP) loadable file
  14662. >15    byte    0    Optimized for Intel
  14663. >15    byte    1    Optimized for Non-Intel
  14664. 1    string    WPC    (Corel/WP)
  14665. >8    short    257    WordPerfect macro
  14666. >8    short    258    WordPerfect help file
  14667. >8    short    259    WordPerfect keyboard file
  14668. >8    short    266    WordPerfect document
  14669. >8    short    267    WordPerfect dictionary
  14670. >8    short    268    WordPerfect thesaurus
  14671. >8    short    269    WordPerfect block
  14672. >8    short    270    WordPerfect rectangular block
  14673. >8    short    271    WordPerfect column block
  14674. >8    short    272    WordPerfect printer data
  14675. >8    short    275    WordPerfect printer data
  14676. >8    short    276    WordPerfect driver resource data
  14677. >8    short    279    WordPerfect hyphenation code
  14678. >8    short    280    WordPerfect hyphenation data
  14679. >8    short    281    WordPerfect macro resource data
  14680. >8    short    283    WordPerfect hyphenation lex
  14681. >8    short    285    WordPerfect wordlist
  14682. >8    short    286    WordPerfect equation resource data
  14683. >8    short    289    WordPerfect spell rules
  14684. >8    short    290    WordPerfect dictionary rules
  14685. >8    short    295    WordPerfect spell rules (Microlytics)
  14686. >8    short    299    WordPerfect settings file
  14687. >8    short    301    WordPerfect 4.2 document
  14688. >8    short    325    WordPerfect dialog file
  14689. >8    short    332    WordPerfect button bar
  14690. >8    short    513    Shell macro
  14691. >8    short    522    Shell definition
  14692. >8    short    769    Notebook macro
  14693. >8    short    770    Notebook help file
  14694. >8    short    771    Notebook keyboard file
  14695. >8    short    778    Notebook definition
  14696. >8    short    1026    Calculator help file
  14697. >8    short     1538    Calendar help file
  14698. >8    short     1546    Calendar data file
  14699. >8    short    1793    Editor macro
  14700. >8    short    1794    Editor help file
  14701. >8    short    1795    Editor keyboard file
  14702. >8    short    1817    Editor macro resource file
  14703. >8    short     2049    Macro editor macro
  14704. >8    short     2050    Macro editor help file
  14705. >8    short    2051    Macro editor keyboard file
  14706. >8    short    2305    PlanPerfect macro
  14707. >8    short    2306    PlanPerfect help file
  14708. >8    short    2307    PlanPerfect keyboard file
  14709. >8    short    2314    PlanPerfect worksheet
  14710. >8    short    2319    PlanPerfect printer definition
  14711. >8    short    2322    PlanPerfect graphic definition
  14712. >8    short    2323    PlanPerfect data
  14713. >8    short    2324    PlanPerfect temporary printer
  14714. >8    short    2329    PlanPerfect macro resource data
  14715. >8    byte    11    Mail
  14716. >8    short    2818    help file
  14717. >8    short    2821    distribution list
  14718. >8    short    2826    out box
  14719. >8    short    2827    in box
  14720. >8    short    2836    users archived mailbox
  14721. >8    short    2837    archived message database
  14722. >8    short    2838    archived attachments
  14723. >8    short    3083    Printer temporary file
  14724. >8    short    3330    Scheduler help file
  14725. >8    short    3338    Scheduler in file
  14726. >8    short    3339    Scheduler out file
  14727. >8    short    3594    GroupWise settings file
  14728. >8    short    3601    GroupWise directory services
  14729. >8    short    3627    GroupWise settings file
  14730. >8    short    4362    Terminal resource data
  14731. >8    short    4363    Terminal resource data
  14732. >8    short    4395    Terminal resource data
  14733. >8    short    4619    GUI loadable text
  14734. >8    short    4620    graphics resource data
  14735. >8    short    4621    printer settings file
  14736. >8    short    4622    port definition file
  14737. >8    short    4623    print queue parameters
  14738. >8    short    4624    compressed file
  14739. >8    short    5130    Network service msg file
  14740. >8    short    5131    Network service msg file
  14741. >8    short    5132    Async gateway login msg
  14742. >8    short    5134    GroupWise message file
  14743. >8    short    7956    GroupWise admin domain database
  14744. >8    short    7957    GroupWise admin host database
  14745. >8    short    7959    GroupWise admin remote host database
  14746. >8    short    7960    GroupWise admin ADS deferment data file
  14747. >8    short    8458    IntelliTAG (SGML) compiled DTD
  14748. >8    long    18219264    WordPerfect graphic image (1.0)
  14749. >8    long    18219520    WordPerfect graphic image (2.0)
  14750. #end of WordPerfect type files Version 1.6 - PLEASE DO NOT REMOVE THIS LINE
  14751.  
  14752. # Hangul (Korean) Word Processor File
  14753. 0    string    HWP\ Document\ File    Hangul (Korean) Word Processor File 3.0
  14754. # From: Won-Kyu Park <wkpark@kldp.org>
  14755. 512    string        R\0o\0o\0t\0    Hangul (Korean) Word Processor File 2000
  14756. !:mime    application/x-hwp
  14757.  
  14758. # CosmicBook, from BenoƓt Rouits
  14759. 0       string  CSBK    Ted Neslson's CosmicBook hypertext file
  14760.  
  14761. 2       string  EYWR    AmigaWriter file
  14762.  
  14763. # chi:  file(1) magic for ChiWriter files
  14764. 0       string          \\1cw\          ChiWriter file
  14765. >5      string          >\0             version %s
  14766. 0       string          \\1cw           ChiWriter file
  14767.  
  14768. # Quark Express from http://www.garykessler.net/library/file_sigs.html
  14769. 2    string    IIXPR3            Intel Quark Express Document (English)
  14770. 2    string    IIXPRa            Intel Quark Express Document (Korean)
  14771. 2    string    MMXPR3            Motorola Quark Express Document (English)
  14772. !:mime    application/x-quark-xpress-3
  14773. 2    string    MMXPRa            Motorola Quark Express Document (Korean)
  14774.  
  14775. # adobe indesign (document, whatever...) from querkan
  14776. 0    belong    0x0606edf5        Adobe InDesign
  14777. >16    string    DOCUMENT        Document
  14778.  
  14779. #------------------------------------------------------------------------------
  14780. # ichitaro456: file(1) magic for Just System Word Processor Ichitaro
  14781. #
  14782. # Contributor kenzo-:
  14783. # Reversed-engineered JS Ichitaro magic numbers
  14784. #
  14785.  
  14786. 0    string        DOC
  14787. >43    byte        0x14    Just System Word Processor Ichitaro v4
  14788. !:mime    application/x-ichitaro4
  14789. >144    string    JDASH        application/x-ichitaro4
  14790.  
  14791. 0    string        DOC
  14792. >43    byte        0x15    Just System Word Processor Ichitaro v5
  14793. !:mime    application/x-ichitaro5
  14794.  
  14795. 0    string        DOC
  14796. >43    byte        0x16    Just System Word Processor Ichitaro v6
  14797. !:mime    application/x-ichitaro6
  14798.  
  14799. # Type: Freemind mindmap documents
  14800. # From: Jamie Thompson <debian-bugs@jamie-thompson.co.uk>
  14801. 0    string/cB    \<map\ version    Freemind document
  14802. !:mime    application/x-freemind
  14803.  
  14804. # Type:        Scribus
  14805. # From:        Werner Fink <werner@suse.de>
  14806. 0    string    \<SCRIBUSUTF8\ Version        Scribus Document
  14807. 0    string    \<SCRIBUSUTF8NEW\ Version    Scribus Document
  14808. !:mime    application/x-scribus
  14809.  
  14810. #------------------------------------------------------------------------------
  14811. # file(1) magic(5) data for xdelta  Josh MacDonald <jmacd@CS.Berkeley.EDU>
  14812. #
  14813. 0    string    %XDELTA%    XDelta binary patch file 0.14
  14814. 0    string    %XDZ000%    XDelta binary patch file 0.18
  14815. 0    string    %XDZ001%    XDelta binary patch file 0.20
  14816. 0    string    %XDZ002%    XDelta binary patch file 1.0
  14817. 0    string    %XDZ003%    XDelta binary patch file 1.0.4
  14818. 0    string    %XDZ004%    XDelta binary patch file 1.1
  14819.  
  14820. #------------------------------------------------------------------------------
  14821. # xenix:  file(1) magic for Microsoft Xenix
  14822. #
  14823. # "Middle model" stuff, and "Xenix 8086 relocatable or 80286 small
  14824. # model" lifted from "magic.xenix", with comment "derived empirically;
  14825. # treat as folklore until proven"
  14826. #
  14827. # "small model", "large model", "huge model" stuff lifted from XXX
  14828. #
  14829. # XXX - "x.out" collides with PDP-11 archives
  14830. #
  14831. 0    string        core        core file (Xenix)
  14832. 0    byte        0x80        8086 relocatable (Microsoft)
  14833. 0    leshort        0xff65        x.out
  14834. >2    string        __.SYMDEF     randomized
  14835. >0    byte        x        archive
  14836. 0    leshort        0x206        Microsoft a.out
  14837. >8    leshort        1        Middle model
  14838. >0x1e    leshort        &0x10        overlay
  14839. >0x1e    leshort        &0x2        separate
  14840. >0x1e    leshort        &0x4        pure
  14841. >0x1e    leshort        &0x800        segmented
  14842. >0x1e    leshort        &0x400        standalone
  14843. >0x1e    leshort        &0x8        fixed-stack
  14844. >0x1c    byte        &0x80        byte-swapped
  14845. >0x1c    byte        &0x40        word-swapped
  14846. >0x10    lelong        >0        not-stripped
  14847. >0x1e    leshort        ^0xc000        pre-SysV
  14848. >0x1e    leshort        &0x4000        V2.3
  14849. >0x1e    leshort        &0x8000        V3.0
  14850. >0x1c    byte        &0x4        86
  14851. >0x1c    byte        &0xb        186
  14852. >0x1c    byte        &0x9        286
  14853. >0x1c    byte        &0xa        386
  14854. >0x1f    byte        <0x040        small model
  14855. >0x1f    byte        =0x048        large model    
  14856. >0x1f    byte        =0x049        huge model 
  14857. >0x1e    leshort        &0x1        executable
  14858. >0x1e    leshort        ^0x1        object file
  14859. >0x1e    leshort        &0x40        Large Text
  14860. >0x1e    leshort        &0x20        Large Data
  14861. >0x1e    leshort        &0x120        Huge Objects Enabled
  14862. >0x10    lelong        >0        not stripped
  14863.  
  14864. 0    leshort        0x140        old Microsoft 8086 x.out
  14865. >0x3    byte        &0x4        separate
  14866. >0x3    byte        &0x2        pure
  14867. >0    byte        &0x1        executable
  14868. >0    byte        ^0x1        relocatable
  14869. >0x14    lelong        >0        not stripped
  14870.  
  14871. 0    lelong        0x206        b.out
  14872. >0x1e    leshort        &0x10        overlay
  14873. >0x1e    leshort        &0x2        separate
  14874. >0x1e    leshort        &0x4        pure
  14875. >0x1e    leshort        &0x800        segmented
  14876. >0x1e    leshort        &0x400        standalone
  14877. >0x1e    leshort        &0x1        executable
  14878. >0x1e    leshort        ^0x1        object file
  14879. >0x1e    leshort        &0x4000        V2.3
  14880. >0x1e    leshort        &0x8000        V3.0
  14881. >0x1c    byte        &0x4        86
  14882. >0x1c    byte        &0xb        186
  14883. >0x1c    byte        &0x9        286
  14884. >0x1c    byte        &0x29        286
  14885. >0x1c    byte        &0xa        386
  14886. >0x1e    leshort        &0x4        Large Text
  14887. >0x1e    leshort        &0x2        Large Data
  14888. >0x1e    leshort        &0x102        Huge Objects Enabled
  14889.  
  14890. 0    leshort        0x580        XENIX 8086 relocatable or 80286 small model
  14891.  
  14892. #------------------------------------------------------------------------------
  14893. # This is Aaron's attempt at a MAGIC file for Xilinx .bit files.
  14894. # Xilinx-Magic@RevRagnarok.com
  14895. # Got the info from FPGA-FAQ 0026
  14896. #
  14897. # First there is the sync header and its length
  14898. 0    beshort 0x0009
  14899. >2     belong    =0x0ff00ff0
  14900. >>&0    belong  =0x0ff00ff0
  14901. >>>&0    beshort =0x0000    
  14902. >>>>&0    pstring    a    Xilinx BIT data
  14903. # Next is a Pascal-style string with the NCD name. We want to capture that.
  14904. >>>>0x0F    pstring    x    - from %s
  14905. # It is followed by a NUL
  14906. >>>>>&1    byte    0x00
  14907. # And then 'b'
  14908. >>>>>&2    string b
  14909. # With the part number:
  14910. #>>>>>&5 string    4v    (Virtex4)
  14911. #>>>>>&5 string  2v    (Virtex II
  14912. #>>>>>>&0    string    !p    \b)
  14913. #>>>>>>&0    string    p    Pro)
  14914. >>>>>&4    pstring x    - for %s
  14915. # And then NUL / 'c' / Build Data / NUL / 'd' / Date / NUL / 'e' / Data Length
  14916. >>>>>>&1    byte    0x00
  14917. >>>>>>&2    string    c
  14918. >>>>>>&4    pstring    x    - built %s
  14919. >>>>>>>&1    byte    0x00
  14920. >>>>>>>&2    string    d
  14921. >>>>>>>&4    pstring    x    \b(%s)
  14922. >>>>>>>>&1    byte    0x00
  14923. >>>>>>>>&2    string    e
  14924. >>>>>>>>&4    belong    x    - data length 0x%lx
  14925.  
  14926. #------------------------------------------------------------------------------
  14927. # xo65 object files
  14928. # From: "Ullrich von Bassewitz" <uz@cc65.org>
  14929. #
  14930. 0    string        \x55\x7A\x6E\x61    xo65 object,
  14931. >4    leshort        x            version %d,
  14932. >6    leshort&0x0001 =0x0001            with debug info
  14933. >6    leshort&0x0001 =0x0000            no debug info
  14934.  
  14935. # xo65 library files
  14936. 0    string        \x6E\x61\x55\x7A    xo65 library,
  14937. >4    leshort        x            version %d
  14938.  
  14939. # o65 object files
  14940. 0    string        \x01\x00\x6F\x36\x35    o65
  14941. >6    leshort&0x1000    =0x0000            executable,
  14942. >6    leshort&0x1000    =0x1000            object,
  14943. >5    byte        x            version %d,
  14944. >6    leshort&0x8000    =0x8000            65816,
  14945. >6    leshort&0x8000    =0x0000            6502,
  14946. >6    leshort&0x2000    =0x2000            32 bit,
  14947. >6    leshort&0x2000    =0x0000            16 bit,
  14948. >6    leshort&0x4000    =0x4000            page reloc,
  14949. >6    leshort&0x4000    =0x0000            byte reloc,
  14950. >6    leshort&0x0003    =0x0000            alignment 1
  14951. >6    leshort&0x0003    =0x0001            alignment 2
  14952. >6    leshort&0x0003    =0x0002            alignment 4
  14953. >6    leshort&0x0003    =0x0003            alignment 256
  14954.  
  14955. #------------------------------------------------------------------------------
  14956. # xwindows:  file(1) magic for various X/Window system file formats.
  14957.  
  14958. # Compiled X Keymap 
  14959. # XKM (compiled X keymap) files (including version and byte ordering)
  14960. 1    string    mkx                Compiled XKB Keymap: lsb,
  14961. >0    byte    >0                version %d
  14962. >0    byte    =0                obsolete
  14963. 0    string    xkm                Compiled XKB Keymap: msb,
  14964. >3    byte    >0                version %d
  14965. >0    byte    =0                obsolete
  14966.  
  14967. # xfsdump archive
  14968. 0    string    xFSdump0            xfsdump archive
  14969. >8    belong    x    (version %d)
  14970.  
  14971. # Jaleo XFS files
  14972. 0    long    395726                Jaleo XFS file
  14973. >4    long    x                - version %ld
  14974. >8    long    x                - [%ld -
  14975. >20    long    x                %ldx
  14976. >24    long    x                %ldx
  14977. >28    long    1008                YUV422]
  14978. >28    long    1000                RGB24]
  14979.  
  14980. #------------------------------------------------------------------------------
  14981. # zilog:  file(1) magic for Zilog Z8000.
  14982. #
  14983. # Was it big-endian or little-endian?  My Product Specification doesn't
  14984. # say.
  14985. #
  14986. 0    long        0xe807        object file (z8000 a.out)
  14987. 0    long        0xe808        pure object file (z8000 a.out)
  14988. 0    long        0xe809        separate object file (z8000 a.out)
  14989. 0    long        0xe805        overlay object file (z8000 a.out)
  14990.  
  14991. #------------------------------------------------------------------------------
  14992. # zyxel:  file(1) magic for ZyXEL modems
  14993. #
  14994. # From <rob@pe1chl.ampr.org>
  14995. # These are the /etc/magic entries to decode datafiles as used for the
  14996. # ZyXEL U-1496E DATA/FAX/VOICE modems.  (This header conforms to a
  14997. # ZyXEL-defined standard)
  14998.  
  14999. 0    string        ZyXEL\002    ZyXEL voice data
  15000. >10    byte        0        - CELP encoding
  15001. >10    byte&0x0B    1        - ADPCM2 encoding
  15002. >10    byte&0x0B    2        - ADPCM3 encoding
  15003. >10    byte&0x0B    3        - ADPCM4 encoding
  15004. >10    byte&0x0B    8        - New ADPCM3 encoding
  15005. >10    byte&0x04    4        with resync
  15006.